dts_warper.txt 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967
  1. //===== eAthena Script =======================================
  2. //= Dungeon Teleport Service
  3. //===== By: ==================================================
  4. //= Evera
  5. //===== Current Version: =====================================
  6. //= 2.4
  7. //===== Compatible With: =====================================
  8. //= eAthena
  9. //===== Description: =========================================
  10. //= Cool Event Corp NPCs vs. Kafra Dungeon Teleport Service and voting system.
  11. //= This is a special event on official servers where there's a
  12. //= big competition between Kafra Corp. and Cool Event Corp.
  13. //= To warp to selected levels of certain dungeons.
  14. //= Also includes Cool Event Corp HQ NPCs.
  15. //===== Variables: ===========================================
  16. //=Server - $dtsvote = Variable for # of votes
  17. //= = Positive = Cool Corp winning
  18. //= = Negative = Kafra Corp winning
  19. //= $dts = Variable for DTS status
  20. //= = (1<<0) Election
  21. //= = (1<<1) Cool Corp Enabled
  22. //= = (1<<2) Kafra Enabled
  23. //= = (1<<3) No winner last election
  24. //= = (1<<4) Cool Corp won last election
  25. //= = (1<<5) Kafra won last election
  26. //= $dtsday = Week count for dts vote count, used for resetting players' votes
  27. //=Character - dtseligible = eligibility status, 0 not eligible yet, 1 eligible.
  28. //= = $dtsday used when MISC_QUEST|128, and signifies that person already voted.
  29. //= MISC_QUEST = |128 = eligible and voted.
  30. //=NPC Func. - arg(0) = 0, Cool Event Corp Voting Staff; 1, Kafra Corp Voting Staff
  31. //= arg(1) = Kafra only, Cool Corp script does not use. Changes illus for different sprites.
  32. //= = 0 = 4_f_kafra6 (yellow ponytail, classic outfit, spr 112)
  33. //= = 1 = 4_f_kafra5 (pink hair, classic outfit, spr 113)
  34. //= = 2 = 4_f_kafra4 (orange short hair, classic outfit, spr 114)
  35. //= = 3 = 4_f_kafra3 (brown bangs, classic outfit, spr 115)
  36. //= = 4 = 4_f_kafra2 (brown ponytale, classic outfit, spr 116)
  37. //= = 5 = 4_f_kafra1 (blue hair, classic outfit, spr 117)
  38. //= = 6 = 4_f_agentkafra (purp hair, black outfit, spr 859)
  39. //= = 7 = 4_f_kafra8 (blue hair, brown outfit, spr 860)
  40. //= = 8 = 4_f_kafra9 (red hair, brown outfit, spr 861)
  41. //=Temporary - @dtstemp = Temporary buffer, used in GM vote-fixing
  42. //= @dtstemps$ = Temporary buffer, like above, but a string.
  43. //= $@dtstempg = Temporary buffer, but global
  44. //===== Additional Comments: =================================
  45. //= Some unofficial translations, some unofficial dungeon warps
  46. //= Also includes unofficial GM-enabled tweaking for script
  47. //= Includes NPCs in Cool Event Corp headquarters
  48. //= If new locations are found of this NPC, please report on forums
  49. //= http://www.eathena.ws/board/index.php?showforum=106
  50. //= Base level 60 required to vote
  51. //===== Version History: ====================================
  52. //= 1.0 Initial release [Evera]
  53. //= 1.1 SVN release, removed from major town (found true info after research),
  54. //= put more arg(2) parameters, fixed a few bugs [Evera]
  55. //= 1.2 Mushed some variables together, optimized a bit [Evera]
  56. //= 1.3 Removed selfconfig [Evera]
  57. //= 1.4 Changed global variables to read from 3 global variables, updated names,
  58. //= fixed array bug [Evera]
  59. //= 1.5 Mushed voting varialbes into 1 variable. [Evera]
  60. //= 1.6 Removed Duplicates [Silent]
  61. //= 1.7 Fixed bug of DTS_Admin not running by itself [Evera]
  62. //= 1.8 Changed requirement to lvl 60 [Evera]
  63. //= 1.9 Removed global eligibility option [Evera]
  64. //= 2.0 Fixed zeny bug [Evera]
  65. //= 2.1 Fixed headers with and updated with newer information [Evera]
  66. //= 2.2 Changed dtseligible 2 to MISC_QUEST|128, to clean up variable usage. [Evera]
  67. //= Also added F_ClearGarbage function to the scripts. [Evera]
  68. //= 2.3 Changed dtseligible to be $dtsday when MISC_QUEST|128
  69. //= Added $dtsday for vote session counter
  70. //= Fixed bug that involved having both warpers enabled at the same time. [Evera]
  71. //= New $dtsday system and bug fix[Evera]
  72. //= 2.3a fixed 2 bugs with comparision [Lupus]
  73. //= 2.3b corrected Glast warp coords [Lupus] 2.3c Bailand -> Bayalan
  74. //= 2.4 Corrected NPC names to fall within proper restrictions. [L0ne_W0lf]
  75. //============================================================
  76. //Yuno
  77. yuno,153,191,4 script Cool Event Voting Staff::CoolEventVotingStaff01 874,{
  78. callfunc "F_DTS_Warp",0,0;
  79. }
  80. yuno,162,191,6 script Kafra Voting Staff#01 861,{
  81. callfunc "F_DTS_Warp",1,8;
  82. }
  83. //Lighthalzen
  84. lighthalzen,154,60,6 script Cool Event Voting Staff::CoolEventVotingStaff02 874,{
  85. callfunc "F_DTS_Warp",0,0;
  86. }
  87. //Prontera
  88. prontera,147,125,4 script Cool Event Voting Staff::CoolEventVotingStaff03 874,{
  89. callfunc "F_DTS_Warp",0,0;
  90. }
  91. prontera,164,125,6 script Kafra Voting Staff#02 115,{
  92. callfunc "F_DTS_Warp",1,3;
  93. }
  94. //Cool Event Staff Headquarters NPCs
  95. //Kudiuu (Maintenance Guy)
  96. lhz_in02,20,274,6 script Maintenance Guy#dts 851,{
  97. mes "[Kudiuu]";
  98. mes "Holy...!";
  99. mes "Will this place";
  100. mes "ever get cleaned up?!";
  101. mes "*Cough cough* There's";
  102. mes "so much dust here, it's";
  103. mes "almost a health hazard!";
  104. close;
  105. }
  106. //Cesuna (Zondaman at desk)
  107. lhz_in02,36,284,1 script Cool Event Staff#01 874,{
  108. mes "[Cesuna]";
  109. mes "Ack! I'm totally";
  110. mes "swamped with all this";
  111. mes "work! But I don't wannna";
  112. mes "do any of it. That's it!";
  113. mes "I totally need a break";
  114. next;
  115. mes "[Cesuna]";
  116. mes "*Sigh...*";
  117. mes "I wonder if Saera";
  118. mes "would ever consider";
  119. mes "going out with me?";
  120. mes "That would be nice~";
  121. close;
  122. }
  123. //Jellarin (Event planner)
  124. lhz_in02,40,279,3 script Event Planner 833,{
  125. mes "[Jellarin]";
  126. mes "I don't like this.";
  127. mes "But I don't like that";
  128. mes "idea either. What will";
  129. mes "I do for a new event, eh?";
  130. next;
  131. mes "[Jellarin]";
  132. mes "I need something";
  133. mes "major, something that'll";
  134. mes "really shake up the world,";
  135. mes "something epochal, but what?";
  136. mes "Hey, do you have any ideas";
  137. close;
  138. }
  139. //Baoto (Cool Event Manager)
  140. lhz_in02,110,283,5 script Cool Event Manager 853,{
  141. mes "[Baoto]";
  142. mes "Hmmm...";
  143. mes "The employees seem";
  144. mes "to be having too much";
  145. mes "fun amongst themselves";
  146. mes "recently. This does not";
  147. mes "bode well at all...";
  148. next;
  149. mes "[Baoto]";
  150. mes "It looks like I'm";
  151. mes "just going to have to";
  152. mes "start cracking that whip";
  153. mes "more often and much";
  154. mes "harder. Ha ha ha ha!";
  155. close;
  156. }
  157. //Saera (Secretary), contains GM menu
  158. lhz_in02,36,274,3 script Cool Event Staff#02 831,{
  159. callfunc "F_ClearGarbage"; //Clear outdated, unused variables
  160. if($dts == 0){
  161. set $dts,$dts|(1<<0); //Sets NPCs to election mode if first time running
  162. set $dts,$dts|(1<<3);
  163. }
  164. if($dts&(1<<1) && $dts&(1<<2) || $dts&(1<<0) && $dts&(1<<1) || $dts&(1<<0) && $dts&(1<<2)){
  165. if($dts&(1<<0)) set $dts,$dts&~(1<<0);
  166. if($dts&(1<<1)) set $dts,$dts&~(1<<1);
  167. if($dts&(1<<2)) set $dts,$dts&~(1<<2);
  168. set $dts,$dts|(1<<0);
  169. }
  170. if($dts&(1<<4) && $dts&(1<<5) || $dts&(1<<3) && $dts&(1<<4) || $dts&(1<<3) && $dts&(1<<5)){
  171. if($dts&(1<<3)) set $dts,$dts&~(1<<3);
  172. if($dts&(1<<4)) set $dts,$dts&~(1<<4);
  173. if($dts&(1<<5)) set $dts,$dts&~(1<<5);
  174. set $dts,$dts|(1<<3);
  175. }
  176. mes "[Saera]";
  177. mes "Welcome to the";
  178. mes "temporary headquarters";
  179. mes "of Cool Event Corporation";
  180. mes "How may I help you today?";
  181. next;
  182. if(getgmlevel()>=40){ //Unofficial Text, GM-configurable settings for Event (GM level above 40 required)
  183. mes "[Saera]";
  184. mes "Why, I didn't even";
  185. mes "notice you there,";
  186. mes strcharinfo(0)+". What would";
  187. mes "you like to do today?";
  188. next;
  189. menu "Fix Vote",Lfixvote,
  190. "Set current teleporter",Lsettele,
  191. "Set last election winner",Lsetlast,
  192. "Manually run vote check",Lmanuvotecheck,
  193. "Normal menu please",-;
  194. mes "[Saera]";
  195. mes "Ok";
  196. next;
  197. }
  198. menu "Temporary headquarters?",Ltemphead,
  199. "Voting",Lvoting,"No, thanks.",Lnothx;
  200. Ltemphead:
  201. mes "[Saera]";
  202. mes "Our headquarters building";
  203. mes "is currently undergoing";
  204. mes "reconstruction, so we are";
  205. mes "basing our operations in";
  206. mes "this place for the meantime";
  207. close;
  208. Lvoting:
  209. mes "[Saera]";
  210. mes "Currently, Kafra Corporation";
  211. mes "and Cool Event Corp are working";
  212. mes "on a collaborative program that";
  213. mes "will provide direct teleport";
  214. mes "services to dungeons.";
  215. next;
  216. mes "[Saera]";
  217. mes "Due to technical issues,";
  218. mes "both companies cannot provide";
  219. mes "teleport services to the same";
  220. mes "dungeon. Therefore, we will be";
  221. mes "selecting our valued customers";
  222. mes "to choose the company they want.";
  223. next;
  224. if((dtseligible == 0 || dtseligible == 3) && baselevel >= 60 && MISC_QUEST&128 == 0) set dtseligible,1;
  225. //Clear previous var of dtseligible,3 being tried for eligibility already
  226. if(dtseligible != $dtsday && baselevel >= 60 && MISC_QUEST&128){
  227. set MISC_QUEST,MISC_QUEST&~128;
  228. set dtseligible,1;
  229. }
  230. switch(dtseligible){
  231. default:
  232. mes "[Saera]";
  233. mes "Only a limited number of";
  234. mes "voters will be chosen, so";
  235. mes "you can check your voting";
  236. mes "eligibility at the headquarters";
  237. mes "of both participating companies.";
  238. mes "Thank you for your patronage~";
  239. close;
  240. break;
  241. case 1:
  242. mes "[Saera]";
  243. mes "It appears that you are";
  244. mes "eligible to vote";
  245. mes "so please cast your";
  246. mes "vote at any Voting Staff";
  247. mes "representative. Thank you~";
  248. close;
  249. break;
  250. case 2:
  251. mes "[Saera]";
  252. mes "You are eligible to vote, but";
  253. mes "you have already voted. Thank";
  254. mes "you for your participation";
  255. close;
  256. break;
  257. }
  258. Lnothx:
  259. mes "[Saera]";
  260. mes "Thank you.";
  261. mes "Have a good day.";
  262. close;
  263. //GM options start
  264. Lfixvote: //Fix Vote
  265. mes "[Saera]";
  266. mes "Umm, sure..";
  267. if($dtsv > 0) mes "Cool Event Corp is currently winning by "+$dtsv+" votes.";
  268. if($dtsv < 0) mes "Kafra Corp is currently winning by "+$dtsv*-1+" votes.";
  269. if($dtsv == 0) mes "The vote is currently tied.";
  270. mes "To who would you like to give votes to?";
  271. next;
  272. menu "Kafra",-,"Cool Event Corp",Lfixcool;
  273. Lfixkafra: //Fixing vote for Kafra
  274. mes "[Saera]";
  275. if($dtsv > 0) mes "Cool Event Corp is currently winning by "+$dtsv+" votes.";
  276. if($dtsv < 0) mes "Kafra Corp is currently winning by "+$dtsv*-1+" votes."; //multiplied by -1 because var is negative
  277. if($dtsv == 0) mes "The vote is currently tied.";
  278. mes "Please input the amount you wish to give to Kafra Corp";
  279. input @dtstemp; //Set buffer for Kafra vote
  280. next;
  281. mes "[Saera]";
  282. mes "You inputted "+@dtstemp+" for Kafra";
  283. if($dtsv > 0) mes "Cool Event Corp is currently winning by "+$dtsv+" votes.";
  284. if($dtsv < 0) mes "Kafra Corp is currently winning by "+$dtsv*-1+" votes.";
  285. if($dtsv == 0) mes "The vote is currently tied.";
  286. mes "Are you sure you would like to";
  287. mes "make these changes?";
  288. next;
  289. menu "Yes",-,"No",Lnothx;
  290. set $dtsv,$dtsv-@dtstemp; //Set buffer to Kafra vote
  291. mes "[Saera]";
  292. mes "Okay, you fixed the vote";
  293. mes "of Kafra Corp.";
  294. if($dtsv > 0) mes "Cool Event Corp is currently winning by "+$dtsv+" votes.";
  295. if($dtsv < 0) mes "Kafra Corp is currently winning by "+$dtsv*-1+" votes.";
  296. if($dtsv == 0) mes "The vote is currently tied.";
  297. close;
  298. Lfixcool: //Fixing vote for cool corp
  299. mes "[Saera]";
  300. mes "Let me find the papers...";
  301. if($dtsv > 0) mes "Cool Event Corp is currently winning by "+$dtsv+" votes.";
  302. if($dtsv < 0) mes "Kafra Corp is currently winning by "+$dtsv*-1+" votes.";
  303. if($dtsv == 0) mes "The vote is currently tied.";
  304. mes "Please input new vote for Cool Event Corp";
  305. input @dtstemp; //Set buffer for Cool vote
  306. next;
  307. mes "[Saera]";
  308. mes "You inputted "+@dtstemp+" for Cool Event Corp";
  309. if($dtsv > 0) mes "Cool Event Corp is currently winning by "+$dtsv+" votes.";
  310. if($dtsv < 0) mes "Kafra Corp is currently winning by "+$dtsv*-1+" votes.";
  311. if($dtsv == 0) mes "The vote is currently tied.";
  312. mes "Are you sure you would like to";
  313. mes "make these changes?";
  314. next;
  315. menu "Yes",-,"No",Lnothx; //Confirmaiton
  316. set $dtsv,@dtsv+@dtstemp; //Set buffer to Cool vote
  317. mes "[Saera]";
  318. mes "Okay, you fixed the vote";
  319. mes "of Cool Event Corp.";
  320. if($dtsv > 0) mes "Cool Event Corp is currently winning by "+$dtsv+" votes.";
  321. if($dtsv < 0) mes "Kafra Corp is currently winning by "+$dtsv*-1+" votes.";
  322. if($dtsv == 0) mes "The vote is currently tied.";
  323. close;
  324. Lsettele: //Set current DTS tele
  325. mes "[Saera]";
  326. mes "Type Kafra for Kafra-enabled warp,";
  327. mes "Cool for Cool Event Corp-enabled";
  328. mes "warp ,Election for election mode,";
  329. mes "or Cancel to cancel.";
  330. if($dts&(1<<0)) mes "The election is currently in election mode.";
  331. if($dts&(1<<1)) mes "Cool Event Corp is currently the DTS warper.";
  332. if($dts&(1<<2)) mes "Kafra Corp is currently the DTS warper.";
  333. next;
  334. input @dtstemps$; //Typed in choices to prevent mistakes
  335. mes "Let me find the papers...";
  336. next;
  337. if(@dtstemps$ == "Election" || @dtstemps$ == "election"){
  338. if($dts&(1<<1)){
  339. set $dts,$dts&~(1<<1); //Removes previous winner
  340. set $dts,$dts|(1<<0); //Changes status to election
  341. }
  342. if($dts&(1<<2)){
  343. set $dts,$dts&~(1<<2);
  344. set $dts,$dts|(1<<0);
  345. }
  346. mes "[Saera]";
  347. mes "Set to election mode.";
  348. close;
  349. }
  350. if(@dtstemps$ == "Cool" || @dtstemps$ == "cool"){
  351. if($dts&(1<<0)){
  352. set $dts,$dts&~(1<<0);
  353. set $dts,$dts|(1<<1);
  354. }
  355. if($dts&(1<<2)){
  356. set $dts,$dts&~(1<<2);
  357. set $dts,$dts|(1<<1);
  358. }
  359. mes "[Saera]";
  360. mes "Cool Event Corp. is now the DTS warper.";
  361. close;
  362. }
  363. if(@dtstemps$ == "Kafra" || @dtstemps$ == "kafra"){
  364. if($dts&(1<<1)){
  365. set $dts,$dts&~(1<<1);
  366. set $dts,$dts|(1<<2);
  367. }
  368. if($dts&(1<<0)){
  369. set $dts,$dts&~(1<<0);
  370. set $dts,$dts|(1<<2);
  371. }
  372. mes "[Saera]";
  373. mes "Kafra Corp. is now the DTS warper.";
  374. close;
  375. }
  376. if(@dtstemps$ == "Cancel" || @dtstemps$ == "cancel") goto Lnothx;
  377. mes "[Saera]";
  378. mes "Please input a correct name for the election";
  379. next;
  380. goto Lsettele;
  381. Lsetlast: //Set last winner
  382. mes "[Saera]";
  383. mes "Type Kafra for election records to show Kafra,";
  384. mes "Cool for Cool for election records to show Cool Event Corp,";
  385. mes "None for no winner in election records,";
  386. mes "or Cancel to cancel.";
  387. if($dts&(1<<3)) mes "There was no previous winner";
  388. if($dts&(1<<4)) mes "Cool Event Corp was the last winner";
  389. if($dts&(1<<5)) mes "Kafra Corp was the last winner";
  390. next;
  391. input @dtstemps$;
  392. mes "[Saera]";
  393. mes "Let me find the papers...";
  394. next;
  395. if(@dtstemps$ == "None" || @dtstemps$ == "none"){
  396. if($dts&(1<<4)){
  397. set $dts,$dts&~(1<<4); //removes last winner
  398. set $dts,$dts|(1<<3); //sets current last winner
  399. }
  400. if($dts&(1<<5)){
  401. set $dts,$dts&~(1<<5);
  402. set $dts,$dts|(1<<3);
  403. }
  404. mes "[Saera]";
  405. mes "Set records to show no previous winner.";
  406. close;
  407. }
  408. if(@dtstemps$ == "Cool" || @dtstemps$ == "cool"){
  409. if($dts&(1<<3)){
  410. set $dts,$dts&~(1<<3);
  411. set $dts,$dts|(1<<4);
  412. }
  413. if($dts&(1<<5)){
  414. set $dts,$dts&~(1<<5);
  415. set $dts,$dts|(1<<4);
  416. }
  417. mes "[Saera]";
  418. mes "Cool Event Corp. is now the previous winner.";
  419. close;
  420. }
  421. if(@dtstemps$ == "Kafra" || @dtstemps$ == "kafra"){
  422. if($dts&(1<<3)){
  423. set $dts,$dts&~(1<<3);
  424. set $dts,$dts|(1<<5);
  425. }
  426. if($dts&(1<<4)){
  427. set $dts,$dts&~(1<<4);
  428. set $dts,$dts|(1<<5);
  429. }
  430. mes "[Saera]";
  431. mes "Kafra Corp. is now the previous winner.";
  432. close;
  433. }
  434. if(@dtstemps$ == "Cancel" || @dtstemps$ == "cancel") goto Lnothx;
  435. mes "[Saera]";
  436. mes "Please input a correct name";
  437. mes "for previous winner";
  438. next;
  439. goto Lsetlast;
  440. Lmanuvotecheck:
  441. mes "[Saera]";
  442. mes "Are you sure you would like to run";
  443. mes "the vote check again?";
  444. next;
  445. menu "Yes",Lmanuvoteyes,"No",Lnothx;
  446. Lmanuvoteyes:
  447. if($dtsday<4 || $dtsday>=100) set $dtsday,4;
  448. else set $dtsday,$dtsday+1;
  449. if($dts&(1<<1) && $dts&(1<<2) || $dts&(1<<0) && $dts&(1<<1) || $dts&(1<<0) && $dts&(1<<2)){
  450. if($dts&(1<<0)) set $dts,$dts&~(1<<0);
  451. if($dts&(1<<1)) set $dts,$dts&~(1<<1);
  452. if($dts&(1<<2)) set $dts,$dts&~(1<<2);
  453. set $dts,$dts|(1<<0);
  454. }
  455. if($dts&(1<<4) && $dts&(1<<5) || $dts&(1<<3) && $dts&(1<<4) || $dts&(1<<3) && $dts&(1<<5)){
  456. if($dts&(1<<3)) set $dts,$dts&~(1<<3);
  457. if($dts&(1<<4)) set $dts,$dts&~(1<<4);
  458. if($dts&(1<<5)) set $dts,$dts&~(1<<5);
  459. set $dts,$dts|(1<<3);
  460. }
  461. if($dtsv == 0){
  462. set $@dtstemp,rand(1,2);
  463. if($@dtstemp == 1) set $dtsv,$dtsv+100;
  464. else set $dtsv,$dtsv-100;
  465. }
  466. if($dtsv > 0){
  467. if($dts&(1<<3)) set $dts,$dts&~(1<<3); //removes last winner varialbes
  468. if($dts&(1<<4)) set $dts,$dts&~(1<<4);
  469. if($dts&(1<<5)) set $dts,$dts&~(1<<5);
  470. if($dts&(1<<0)){
  471. set $dts,$dts&~(1<<0); //removes winner variable
  472. set $dts,$dts|(1<<3); //sets last winner varialbe
  473. set $dts,$dts|(1<<1); //sets current winner variable
  474. }
  475. if($dts&(1<<1)) set $dts,$dts|(1<<4);
  476. if($dts&(1<<2)){
  477. set $dts,$dts&~(1<<2);
  478. set $dts,$dts|(1<<1);
  479. set $dts,$dts|(1<<5);
  480. }
  481. set $dtsv,0;
  482. }
  483. else{
  484. if($dts&(1<<3)) set $dts,$dts&~(1<<3);
  485. if($dts&(1<<4)) set $dts,$dts&~(1<<4);
  486. if($dts&(1<<5)) set $dts,$dts&~(1<<5);
  487. if($dts&(1<<0)){
  488. set $dts,$dts&~(1<<0);
  489. set $dts,$dts|(1<<2);
  490. set $dts,$dts|(1<<3);
  491. }
  492. if($dts&(1<<1)){
  493. set $dts,$dts&~(1<<1);
  494. set $dts,$dts|(1<<2);
  495. set $dts,$dts|(1<<4);
  496. }
  497. if($dts&(1<<2)) set $dts,$dts|(1<<5);
  498. set $dtsv,0;
  499. }
  500. mes "[Saera]";
  501. mes "Vote check run again.";
  502. if($dts&(1<<0)) mes "The election is currently in election mode.";
  503. if($dts&(1<<1)) mes "Cool Event Corp is currently the DTS warper.";
  504. if($dts&(1<<2)) mes "Kafra Corp is currently the DTS warper.";
  505. close;
  506. }
  507. //Function for Voting Staff NPC
  508. function script F_DTS_Warp {
  509. callfunc "F_ClearGarbage"; //Clear outdated, unused variables
  510. if($dts == 0){ //Sets NPCs to election mode if first time running
  511. set $dts,$dts|(1<<0);
  512. set $dts,$dts|(1<<3);
  513. }
  514. if((dtseligible == 0 || dtseligible == 3) && baselevel >= 60 && MISC_QUEST&128 == 0) set dtseligible,1; //Clear previous var of dtseligible,3 being tried for eligibility already
  515. if(dtseligible != $dtsday && baselevel >= 60 && MISC_QUEST&128){
  516. set MISC_QUEST,MISC_QUEST&~128;
  517. set dtseligible,1;
  518. }
  519. switch(getarg(0)){
  520. case 0:
  521. cutin "zonda_01",2;
  522. mes "[Cool Event Corp. Voting Staff]";
  523. mes "Hello! Don't forget to make";
  524. mes "your voice be heard and make";
  525. mes "sure you vote in the elections";
  526. mes "between Cool Event Corp. and";
  527. mes "Kafra Corporation for control of";
  528. mes "the Dungeon Teleport Service!";
  529. break;
  530. case 1:
  531. switch(getarg(1)){
  532. case 0: cutin "kafra_06",2; break; //Finding arguments to find which illust to use
  533. case 1: cutin "kafra_05",2; break; //Used Red hair "kafra_09" for black outfit kafra
  534. case 2: cutin "kafra_04",2; break; //because I couldn't find a suitable illust
  535. case 3: cutin "kafra_03",2; break;
  536. case 4: cutin "kafra_02",2; break;
  537. case 5: cutin "kafra_01",2; break;
  538. case 6: cutin "kafra_09",2; break;
  539. case 7: cutin "kafra_08",2; break;
  540. case 8: cutin "kafra_09",2; break;
  541. default: cutin "kafra_09",2; break;
  542. }
  543. mes "[Kafra Voting Staff]";
  544. mes "Greetings, adventurer.";
  545. mes "As you may be aware, we";
  546. mes "are holding an election to";
  547. mes "provide the Dungeon Teleport";
  548. mes "Service. How may I help you?";
  549. break;
  550. }
  551. next;
  552. menu "Reason for Election",Lelection,"Cast a Vote",Lvote,
  553. "Use Teleport Service",Lteleport,"Cancel",Lcancel;
  554. Lelection: //Reason for election explanation
  555. switch(getarg(0)){
  556. case 0:
  557. mes "[Cool Event Corp. Voting Staff]";
  558. mes "Cool Event Corp. has been";
  559. mes "planning to provide a new";
  560. mes "Dungeon Teleport Service to";
  561. mes "its customers, a service not";
  562. mes "already provided by the Kafra";
  563. mes "Corporation. However...";
  564. next;
  565. mes "[Cool Event Corp. Voting Staff]";
  566. mes "Kafra Corporation, which";
  567. mes "already monopolizes the";
  568. mes "public teleportation market,";
  569. mes "actually also had plans to";
  570. mes "provide a similar service.";
  571. next;
  572. mes "[Cool Event Corp. Voting Staff]";
  573. mes "Because of technological";
  574. mes "limitations, only one company";
  575. mes "can be chosen as the provider";
  576. mes "of this Dungeon Teleport Service.";
  577. mes "Hence, we will let the customers";
  578. mes "decide through these elections.";
  579. next;
  580. mes "[Cool Event Corp. Voting Staff]";
  581. mes "Multiple elections will be";
  582. mes "held so that our customers";
  583. mes "can test out the special services";
  584. mes "of each company for themselves.";
  585. mes "However, keep in mind that you";
  586. mes "must be eligible in order to vote.";
  587. next;
  588. mes "[Cool Event Corp. Voting Staff]";
  589. mes "For voter eligibility";
  590. mes "details, please visit our";
  591. mes "headquarters in the city of";
  592. mes "Lighthalzen located in the";
  593. mes "Schwarzwald Republic.";
  594. mes "Thank you for your time.";
  595. break;
  596. case 1:
  597. mes "[Kafra Voting Staff]";
  598. mes "Cool Event Corp and the";
  599. mes "Kafra Corporation have both";
  600. mes "been planning to provide a";
  601. mes "Teleport Service to dungeons.";
  602. next;
  603. mes "[Kafra Voting Staff]";
  604. mes "But due to technological";
  605. mes "limitations, only one company";
  606. mes "can serve as provider for this";
  607. mes "Dungeon Teleport Service at a";
  608. mes "time. There, both companies have";
  609. mes "agreed to hold special elections";
  610. next;
  611. mes "[Kafra Voting Staff]";
  612. mes "Each company has its own";
  613. mes "policies and guarantees in";
  614. mes "regards to the Dungeon Teleport";
  615. mes "Service, and in this election, the";
  616. mes "customers will ultimately decide";
  617. mes "and choose what's best for them.";
  618. next;
  619. mes "[Kafra Voting Staff]";
  620. mes "For now, the Dungeon";
  621. mes "Teleport Service will be";
  622. mes "provided in a series of trial";
  623. mes "periods. This way, customers can";
  624. mes "see the benefits of both companies";
  625. mes "before making the final decision";
  626. next;
  627. mes "[Kafra Voting Staff]";
  628. mes "If you are qualified,";
  629. mes "please vote in each election";
  630. mes "to decide which company will";
  631. mes "provide the Dungeon Teleport";
  632. mes "Service for the next trial period.";
  633. mes "Thank you for your support~";
  634. break;
  635. }
  636. goto Lend;
  637. Lvote: //If you clicked you wanted to vote
  638. if(dtseligible == 1) goto Leligible; //Var check if eligible
  639. Lnoteligible: //Text displayed if wanted to vote, but not eligible/voted
  640. switch(getarg(0)){
  641. case 0:
  642. mes "[Cool Event Corp. Voting Staff]";
  643. mes "I'm sorry, but you are not";
  644. mes "eligible to vote at this time.";
  645. mes "Please visit our headquarters";
  646. mes "in Lighthalzen for information";
  647. mes "related to acquiring voting";
  648. mes "rights. Thank you for your time.";
  649. break;
  650. case 1:
  651. mes "[Kafra Voting Staff]";
  652. mes "Oh, I'm so sorry, but you";
  653. mes "are currently not qualified to";
  654. mes "vote. For voting qualification";
  655. mes "information, please visit the";
  656. mes "Al De Baran Kafra Headquarters.";
  657. mes "Thank you and have a nice day.";
  658. break;
  659. }
  660. goto Lend;
  661. Leligible: //Text displayed if eligible to vote
  662. if(MISC_QUEST&128 && $dtsday == dtseligible) goto Lnoteligible; //Var check if voted
  663. switch(getarg(0)){
  664. case 0:
  665. mes "[Cool Event Corp. Voting Staff]"; //Unofficial text
  666. mes "Checking your credentials, you";
  667. mes "are able to vote for the";
  668. mes "Dungeon Teleport Service";
  669. mes "elections. Who would you like";
  670. mes "to vote for?";
  671. break;
  672. case 1:
  673. mes "[Kafra Voting Staff]";
  674. mes "It appears that you qualify";
  675. mes "to vote for the Dungeon";
  676. mes "Teleport Service elections.";
  677. mes "Who would you like to vote for"; //End Unofficial text
  678. break;
  679. }
  680. next;
  681. menu "Cool Event Corp.",Lvotecool,"Kafra Corp.",Lvotekafra;
  682. Lvotecool:
  683. set $dtsv,$dtsv+1; //Adds 1 to cool count
  684. set MISC_QUEST,MISC_QUEST|128; //Sets var so that you can't vote over and over
  685. set dtseligible,$dtsday;
  686. switch(getarg(0)){
  687. case 0:
  688. mes "[Cool Event Corp. Voting Staff]";
  689. mes "Thank you for voting for us.";
  690. mes "Your vote has been counted,";
  691. mes "and we appreciate your input";
  692. mes "Thank you and have a good day.";
  693. break;
  694. case 1:
  695. mes "[Kafra Voting Staff]";
  696. mes "We thank you for your vote.";
  697. mes "Your opinion matters very much";
  698. mes "and has been counted for Cool";
  699. mes "Event Corp.";
  700. break;
  701. }
  702. goto Lend;
  703. Lvotekafra:
  704. setd $dtsv,$dtsv-1; //Adds 1 to kafra count
  705. set MISC_QUEST,MISC_QUEST|128; //Sets var to prevent cheating
  706. set dtseligible,$dtsday;
  707. switch(getarg(0)){
  708. case 0:
  709. mes "[Cool Event Corp. Voting Staff]"; //Unofficial Text
  710. mes "Thank you for your opinion.";
  711. mes "Your vote for Kafra corp.";
  712. mes "has been counted. Thank";
  713. mes "you and have a good day.";
  714. break;
  715. case 1:
  716. mes "[Kafra Voting Staff]";
  717. mes "Your vote for us has been";
  718. mes "counted. We thank you very";
  719. mes "much for your input, and";
  720. mes "we hope that we meet your";
  721. mes "adventuring needs and";
  722. mes "standards of excellence.";
  723. break;
  724. }
  725. goto Lend; //End Unofficial text
  726. Lteleport: //Selected Teleport
  727. switch(getarg(0)){
  728. case 0:
  729. if($dts&(1<<0)){
  730. mes "[Cool Event Corp. Voting Staff]";
  731. mes "I'm sorry, but the";
  732. mes "Dungeon Teleport Service is";
  733. mes "unavailable during elections";
  734. mes "and will be reactivated after the";
  735. mes "election results are announced.";
  736. mes "Thank you and have a nice day.";
  737. goto Lend;
  738. }
  739. if($dts&(1<<1)) goto Lteleenabled;
  740. mes "[Cool Event Corp. Voting Staff]"; //Text if Kafra won DTS elect.
  741. mes "I'm sorry, but Cool Event";
  742. mes "Corp. does not currently offer";
  743. mes "the Dungeon Teleport Service";
  744. mes "due to the results of the last";
  745. mes "election. Please vote for us";
  746. mes "next time, alright? Good day~";
  747. break;
  748. case 1:
  749. if($dts&(1<<0)){
  750. mes "[Kafra Voting Staff]";
  751. mes "Sorry, but the elections for";
  752. mes "which Dungeon Teleport System";
  753. mes "to use is currently going on";
  754. mes "right now. We are unable to";
  755. mes "vote until results are announced";
  756. goto Lend;
  757. }
  758. if($dts&(1<<2)) goto Lteleenabled;
  759. mes "[Kafra Voting Staff]";
  760. mes "We're sorry, but Kafra Corp";
  761. mes "doesn't currently offer the";
  762. mes "Dungeon Teleport System due";
  763. mes "to last election's results,";
  764. mes "Please vote for Kafra Corp";
  765. mes "next time~";
  766. break;
  767. }
  768. goto Lend;
  769. Lteleenabled: //Shows DTS tele selections
  770. cleararray @dtswarpmap$[0],"",getarraysize(@dtswarpmap$);
  771. cleararray @dtswarp$[0],"",getarraysize(@dtswarp$);
  772. switch(getarg(0)){
  773. case 0:
  774. mes "[Cool Event Corp. Voting Staff]";
  775. mes "Please remember that we";
  776. mes "cannot accept Free Warp Tickets";
  777. mes "or award Special Reserve Points";
  778. mes "for this service. Now, please";
  779. mes "choose your destination.";
  780. setarray @dtswarpmap$[0],"Byalan, Level 4","Clock Tower, Basement 3";
  781. setarray @dtswarp$[0],@dtswarpmap$[0]+" -> 4,000z",
  782. @dtswarpmap$[1]+" -> 4,000z","Cancel";
  783. if($dts&(1<<4)){
  784. set @dtswarpmap$[2],"Glastheim Entrance";
  785. setarray @dtswarp$[2],@dtswarpmap$[2]+" -> 4,000z","Cancel";
  786. }
  787. break;
  788. case 1:
  789. mes "[Kafra Voting Staff]";
  790. mes "Thank you for choosing the";
  791. mes "Dungeon Teleport Service";
  792. mes "Please keep in mind that the";
  793. mes "Free Warp Tickets and Kafra";
  794. mes "Special Reserve Points do not";
  795. mes "apply in this special service.";
  796. setarray @dtswarpmap$[0],"Toy Factory, Level 2","Clock Tower, Level 3";
  797. setarray @dtswarp$[0],@dtswarpmap$[0]+" -> 4,000z",
  798. @dtswarpmap$[1]+" -> 4,000z","Cancel";
  799. if($dts&(1<<5)){
  800. set @dtswarpmap$[2],"Lava Dungeon, Level 2";
  801. setarray @dtswarp$[2],@dtswarpmap$[2]+" -> 4,000z","Cancel";
  802. }
  803. break;
  804. }
  805. next;
  806. switch(select(@dtswarp$[0],@dtswarp$[1],@dtswarp$[2],@dtswarp$[3])){
  807. case 1:
  808. set @num, 0;
  809. break;
  810. case 2:
  811. set @num, 1;
  812. break;
  813. case 3:
  814. set @num, 2;
  815. break;
  816. case 4:
  817. set @num, 3;
  818. break;
  819. }
  820. Lwarp:
  821. if (@dtswarp$[@num] == "Cancel") goto Lcancel;
  822. if (Zeny<4000) goto Lnomoney;
  823. set Zeny, Zeny-4000;
  824. if (@dtswarpmap$[@num] == "Toy Factory, Level 2") warp "xmas_dun02",130,123;
  825. //Maps to warp to
  826. if (@dtswarpmap$[@num] == "Clock Tower, Level 3") warp "alde_dun03",265,22;
  827. if (@dtswarpmap$[@num] == "Lava Dungeon, Level 2") warp "mag_dun02",47,40;
  828. if (@dtswarpmap$[@num] == "Byalan, Level 4") warp "iz_dun03",32,63;
  829. if (@dtswarpmap$[@num] == "Clock Tower, Basement 3") warp "alde_dun03",277,178;
  830. if (@dtswarpmap$[@num] == "Glastheim Entrance") warp "glast_01",370,304;
  831. cutin "", 255;
  832. end;
  833. Lnomoney:
  834. switch(getarg(0)){
  835. case 0:
  836. mes "[Cool Event Corp. Voting Staff]"; //Unofficial Text
  837. mes "Umm, apparently you don't have";
  838. mes "adequate funds for your";
  839. mes "selected warp. Please check";
  840. mes "that you have the correct amount";
  841. mes "of money, and try again later";
  842. break;
  843. case 1:
  844. mes "[Kafra Voting Staff]";
  845. mes "It appears as if you don't";
  846. mes "have enough zeny for the warp";
  847. mes "Please check your funds and";
  848. mes "try again.";
  849. break;
  850. }
  851. goto Lend; //End unofficial text
  852. Lcancel: //Selected Cancel on first menu
  853. switch(getarg(0)){
  854. case 0:
  855. mes "[Cool Event Corp. Voting Staff]";
  856. mes "Cool Event Corp. is always";
  857. mes "working to make sure that";
  858. mes "not only are our customers";
  859. mes "satisfied, but that we also";
  860. mes "exceed your utmost standards.";
  861. mes "Thank you and have a good day.";
  862. break;
  863. case 1:
  864. mes "[Kafra Voting Staff]";
  865. mes "We, here at Kafra Corporation,";
  866. mes "are alwyas endeavoring to provide";
  867. mes "you with the best services. We hope";
  868. mes "that we meet your adventuring needs";
  869. mes "and the standards of excellence.";
  870. break;
  871. }
  872. goto Lend;
  873. Lend:
  874. close2;
  875. cutin "", 255;
  876. end;
  877. }
  878. //Elections administration NPC (hidden)
  879. - script DTS_Admin -1,{
  880. OnSun0100: //Works only at 1am on sunday
  881. if($dtsday<4 || $dtsday>=100) set $dtsday,4;
  882. else set $dtsday,$dtsday+1;
  883. if($dts == 0){
  884. set $dts,$dts|(1<<0);
  885. set $dts,$dts|(1<<3);
  886. }
  887. if($dts&(1<<1) && $dts&(1<<2) || $dts&(1<<0) && $dts&(1<<1) || $dts&(1<<0) && $dts&(1<<2)){
  888. if($dts&(1<<0)) set $dts,$dts&~(1<<0);
  889. if($dts&(1<<1)) set $dts,$dts&~(1<<1);
  890. if($dts&(1<<2)) set $dts,$dts&~(1<<2);
  891. set $dts,$dts|(1<<0);
  892. }
  893. if($dts&(1<<4) && $dts&(1<<5) || $dts&(1<<3) && $dts&(1<<4) || $dts&(1<<3) && $dts&(1<<5)){
  894. if($dts&(1<<3)) set $dts,$dts&~(1<<3);
  895. if($dts&(1<<4)) set $dts,$dts&~(1<<4);
  896. if($dts&(1<<5)) set $dts,$dts&~(1<<5);
  897. set $dts,$dts|(1<<3);
  898. }
  899. if($dtsv == 0){ //If tied, gives random side 100 votes
  900. set $@dtstemp,rand(1,2);
  901. if($@dtstemp == 1) set $dtsv,$dtsv+100;
  902. else set $dtsv,$dtsv-100;
  903. }
  904. if($dtsv > 0){
  905. if($dts&(1<<3)) set $dts,$dts&~(1<<3);
  906. if($dts&(1<<4)) set $dts,$dts&~(1<<4);
  907. if($dts&(1<<5)) set $dts,$dts&~(1<<5);
  908. if($dts&(1<<0)){
  909. set $dts,$dts&~(1<<0);
  910. set $dts,$dts|(1<<1);
  911. set $dts,$dts|(1<<3);
  912. }
  913. if($dts&(1<<1)) set $dts,$dts|(1<<4);
  914. if($dts&(1<<2)){
  915. set $dts,$dts&~(1<<2);
  916. set $dts,$dts|(1<<1);
  917. set $dts,$dts|(1<<5);
  918. }
  919. set $dtsv,0;
  920. }
  921. else{
  922. if($dts&(1<<3)) set $dts,$dts&~(1<<3);
  923. if($dts&(1<<4)) set $dts,$dts&~(1<<4);
  924. if($dts&(1<<5)) set $dts,$dts&~(1<<5);
  925. if($dts&(1<<0)){
  926. set $dts,$dts&~(1<<0);
  927. set $dts,$dts|(1<<2);
  928. set $dts,$dts|(1<<3);
  929. }
  930. if($dts&(1<<1)){
  931. set $dts,$dts&~(1<<1);
  932. set $dts,$dts|(1<<2);
  933. set $dts,$dts|(1<<4);
  934. }
  935. if($dts&(1<<2)) set $dts,$dts|(1<<5);
  936. set $dtsv,0;
  937. }
  938. end;
  939. }