dts_warper.txt 29 KB

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