diff options
Diffstat (limited to 'npc/other/dts_warper.txt')
-rw-r--r-- | npc/other/dts_warper.txt | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/npc/other/dts_warper.txt b/npc/other/dts_warper.txt index 005c4e69f..9d9b3a339 100644 --- a/npc/other/dts_warper.txt +++ b/npc/other/dts_warper.txt @@ -3,7 +3,7 @@ //===== By: ==================================================
//= Evera
//===== Current Version: =====================================
-//= 2.0
+//= 2.2
//===== Compatible With: =====================================
//= eAthena
//===== Description: =========================================
@@ -23,7 +23,8 @@ //= = (1<<3) No winner last election
//= = (1<<4) Cool Corp won last election
//= = (1<<5) Kafra won last election
-//=Character - dtseligible = eligibility status, 0 not eligible yet, 1 eligible, 2 eligible & voted.
+//=Character - dtseligible = eligibility status, 0 not eligible yet, 1 eligible. 0 Also used when MISC_QUEST|128, and signifies that person already voted.
+//= MISC_QUEST = |128 = eligible and voted.
//=NPC Func. - arg(0) = 0, Cool Event Corp Voting Staff; 1, Kafra Corp Voting Staff
//= arg(1) = Kafra only, Cool Corp script does not use. Changes illus for different sprites.
//= = 0 = 4_f_kafra6 (yellow ponytail, classic outfit, spr 112)
@@ -60,6 +61,8 @@ //= 1.9 Removed global eligibility option [Evera]
//= 2.0 Fixed zeny bug [Evera]
//= 2.1 Fixed headers with and updated with newer information [Evera]
+//= 2.2 Changed dtseligible 2 to MISC_QUEST|128, to clean up variable usage. [Evera]
+//= Also added F_ClearGarbage function to the scripts. [Evera]
//============================================================
//Yuno
@@ -146,6 +149,7 @@ lhz_in02.gat,110,283,5 script Cool Event Manager 853,{ }
//Saera (Secretary), contains GM menu
lhz_in02.gat,36,274,3 script Cool Event Staff#02 831,{
+ callfunc "F_ClearGarbage"; //Clear outdated, unused variables
if($dts == 0){
set $dts,$dts|(1<<0); //Sets NPCs to election mode if first time running
set $dts,$dts|(1<<3);
@@ -200,7 +204,7 @@ lhz_in02.gat,36,274,3 script Cool Event Staff#02 831,{ mes "selecting our valued customers";
mes "to choose the company they want.";
next;
- if(dtseligible == 0 && baselevel >= 60 || dtseligible == 3 && baselevel >= 60) set dtseligible,1; //Clear previous var of dtseligible,3 being tried for eligibility already
+ if(dtseligible == 0 && baselevel >= 60 && MISC_QUEST&128 == 0 || dtseligible == 3 && baselevel >= 60 && MISC_QUEST&128 == 0) set dtseligible,1; //Clear previous var of dtseligible,3 being tried for eligibility already
switch(dtseligible){
default:
mes "[Saera]";
@@ -210,7 +214,6 @@ lhz_in02.gat,36,274,3 script Cool Event Staff#02 831,{ mes "eligibility at the headquarters";
mes "of both participating companies.";
mes "Thank you for your patronage~";
- set dtseligible,3;
close;
break;
case 1:
@@ -475,11 +478,12 @@ lhz_in02.gat,36,274,3 script Cool Event Staff#02 831,{ //Function for Voting Staff NPC
function script F_DTS_Warp {
+ callfunc "F_ClearGarbage"; //Clear outdated, unused variables
if($dts == 0){ //Sets NPCs to election mode if first time running
set $dts,$dts|(1<<0);
set $dts,$dts|(1<<3);
}
- if(dtseligible == 0 && baselevel >= 60 || dtseligible == 3 && baselevel >= 60) set dtseligible,1; //Clear previous var of dtseligible,3 being tried for eligibility already
+ if(dtseligible == 0 && baselevel >= 60 && MISC_QUEST&128 == 0 || dtseligible == 3 && baselevel >= 60 && MISC_QUEST&128 == 0) set dtseligible,1; //Clear previous var of dtseligible,3 being tried for eligibility already
switch(getarg(0)){
case 0:
cutin "zonda_01",2;
@@ -627,7 +631,7 @@ function script F_DTS_Warp { goto Lend;
Leligible: //Text displayed if eligible to vote
- if(dtseligible == 2) goto Lnoteligible; //Var check if voted
+ if(MISC_QUEST&128) goto Lnoteligible; //Var check if voted
switch(getarg(0)){
case 0:
mes "[Cool Event Corp. Voting Staff]"; //Unofficial text
@@ -650,7 +654,8 @@ function script F_DTS_Warp { Lvotecool:
set $dtsv,$dtsv+1; //Adds 1 to cool count
- set dtseligible,2; //Sets var so that you can't vote over and over
+ set MISC_QUEST,MISC_QUEST|128; //Sets var so that you can't vote over and over
+ set dtseligible,0;
switch(getarg(0)){
case 0:
mes "[Cool Event Corp. Voting Staff]";
@@ -671,7 +676,8 @@ function script F_DTS_Warp { Lvotekafra:
setd $dtsv,$dtsv-1; //Adds 1 to kafra count
- set dtseligible,2; //Sets var to prevent cheating
+ set MISC_QUEST,MISC_QUEST|128; //Sets var to prevent cheating
+ set dtseligible,0;
switch(getarg(0)){
case 0:
mes "[Cool Event Corp. Voting Staff]"; //Unofficial Text
|