dts_warper.txt 29 KB

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