the script is for a quest.
the player goes to a placeable (rock) and "mines" for a gem.
the script then is supposed to give 1 of 6 different gems (it does this)
**only lets player mine 5 times regardless of if they have all gems needed.**
the rocks are supposed to stay mineable until the player has one of each gem needed. (does not do this)
**maybe some kind of check is needed?**
the object of the quest is to get 5 different gems.
a diamond, emerald, ruby, sapphire, and topaz. (a glaspier is given as a dud)
i was looking at the script and noticed there's no check to see if the player has 1 of each gem needed before making the stones unusable. unusable as in not being able to mine the stone for more.
heres the script
///////////////////////////////////////
//// Created by : ShAdOoOw ///
///////////////////////////////////////
#include "pqj_inc"
#include "nw_i0_plot"
void GiveGem(object oPC)
{
switch(Random(6)+1)
{ // create a random gem on successful dig
case 1: CreateItemOnObject("gem_sapphire",oPC);
FloatingTextStringOnCreature("** You have found a Gem **", oPC); // send message with every successful dig
break;
case 2: CreateItemOnObject("gem_topaz",oPC);
FloatingTextStringOnCreature("** You have found a Gem **", oPC);
break;
case 3: CreateItemOnObject("gem_diamond",oPC);
FloatingTextStringOnCreature("** You have found a Gem **", oPC);
break;
case 4: CreateItemOnObject("gem_emerald",oPC);
FloatingTextStringOnCreature("** You have found a Gem **", oPC);
break;
case 5: CreateItemOnObject("gem_ruby",oPC);
FloatingTextStringOnCreature("** You have found a Gem **", oPC);
break;
case 6: CreateItemOnObject("gem_dud",oPC);
FloatingTextStringOnCreature("** You have found a Gem **", oPC);
break;
}
}
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
// if (RetrieveQuestState("q_gems", oPC) == 10 && HasItem(oPC,"plot_pickaxe"))
int nInt = RetrieveQuestState("q_gems",oPC);
if(nInt >= 10 && nInt < 60)
{
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_MID, 1.0, 4.0));
DelayCommand(4.5, GiveGem(oPC));
AddPersistentJournalQuestEntry("q_gems",nInt+10,oPC,FALSE);
FloatingTextStringOnCreature("** Your Journal Has Been Updated **", oPC);
SetUseableFlag(OBJECT_SELF, FALSE);
DelayCommand(900.0, SetUseableFlag(OBJECT_SELF, TRUE));
}
}
I know that this kind of check or something similar should be in there when it's checking for the quest state, but when i try and insert it myself i get errors every time.
if (nInt == 40 && GetItemPossessedBy(oPC,"package_4") != OBJECT_INVALID
&& GetItemPossessedBy(oPC,"gem_emerald") != OBJECT_INVALID
&& GetItemPossessedBy(oPC,"gem_ruby") != OBJECT_INVALID
&& GetItemPossessedBy(oPC,"gem_diamond") != OBJECT_INVALID)
&& GetItemPossessedBy(oPC,"gem_sapphire") != OBJECT_INVALID)
&& GetItemPossessedBy(oPC,"gem_topaz") != OBJECT_INVALID)
any help inserting this in to the script would be appreciated.