Author Topic: Looking for advice on a script  (Read 322 times)

Legacy_archer4217

  • Full Member
  • ***
  • Posts: 206
  • Karma: +0/-0
Looking for advice on a script
« on: April 13, 2011, 10:28:37 pm »


               Hi all,

I have a complicated quest I'd like to set up and would like advice on if I'm going about it the right way or if there's a better way to do it.

The quest involves knights finding 7 shrines. Each discovery will give the knight a new variable...(For instance: find a shrine, get variable 1, find another shrine, change 1 to 2, and so on)... and once they've found all 7 (meaning their variable is now 7), they return to the knight's hall where they'll receive a reward.

It doesn't matter which order they find the shrines in and they should only do this one time.

So, the script would go something like this and be placed on each shrine?
(used LilacSoul's generator)

//Put this script OnUsed
void main()
{

object oPC = GetLastUsedBy();

if (!GetIsPC(oPC)) return;

int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF));

if (DoOnce==TRUE) return;

SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);

int nInt;
nInt = GetLocalInt(oPC, "Virtue Shrine");

nInt += 1;

SetLocalInt(oPC, "Virtue Shrine", nInt);

}

Thanks in advance. '<img'>
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Looking for advice on a script
« Reply #1 on: April 13, 2011, 10:38:48 pm »


               

archer4217 wrote...

I have a complicated quest I'd like to set up and would like advice on if I'm going about it the right way or if there's a better way to do it.



There is always a better way. Even if there is not a better way, someone will think that there way is better.   

So we have to settle for asking if the way we are doing it is good enough for the task at hand.  

Your posted script looks Good  for the task at hand.  

 
               
               

               
            

Legacy_archer4217

  • Full Member
  • ***
  • Posts: 206
  • Karma: +0/-0
Looking for advice on a script
« Reply #2 on: April 13, 2011, 10:48:59 pm »


               Awesome, thanks sweetie '<img'>