henesua

zdlg_check

Jan 21st, 2012
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.45 KB | None | 0 0
  1. //::///////////////////////////////////////////////
  2. //:: zdlg_check
  3. //:://////////////////////////////////////////////
  4. /*
  5.     Starting Conditional for conversation node in z-dialog
  6.     This replaces all of z-dialog's check scripts, reducing the # of scripts by 12.
  7.     You will need to adjust the conversation responses.
  8.     USE: Place in each "Text Appears When" slot in a series of player respone options
  9.  
  10.  
  11.     THANKS to Lightfoot8 for showing me how to create just one script that will work
  12.     to initialize a consecutive series of custom tokens. The reason it works is that
  13.     each "Text appears when" script is executed in order "top to bottom".
  14.     See: http://social.bioware.com/forum/1/topic/192/index/8912939#8913155
  15. */
  16. //:://////////////////////////////////////////////
  17. //:: Original: pspeed - zdlg_check_01.nss,v 1.2 2005/08/07 04:38:30
  18. //:: Rewritten: The Magus (2012 jan 21) based on Lightfoot8's recommendations
  19. //:://////////////////////////////////////////////
  20.  
  21. #include "zdlg_include_i"
  22.  
  23. int StartingConditional()
  24. {
  25.     object oPC      = GetPCSpeaker();
  26.  
  27.     // Determine which "entry" we are checking. Cycles from 1 - 13 then starts over again.
  28.     int nEntry      = GetLocalInt(oPC,"NEXT_ENTRY");
  29.     if(!nEntry || nEntry>13)
  30.         nEntry = 1;
  31.     int nNextEntry = nEntry+1;
  32.     if(nNextEntry>13)
  33.         nNextEntry = 1;
  34.     SetLocalInt(oPC,"NEXT_ENTRY",nNextEntry);
  35.  
  36.     return( _SetupDlgResponse( nEntry - 1, oPC ) );
  37. }
Advertisement
Add Comment
Please, Sign In to add comment