Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.51 KB | None | 0 0
  1. // ....... if your server has { Overwriting user function [int__] } don't blame me ..........
  2. function script int__ {
  3. set .@num, atoi(getarg(0)+"");
  4. if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0);
  5. set .@l, getstrlen(.@num+"");
  6. for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) {
  7. set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$;
  8. if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$;
  9. }
  10. return .@num$;
  11. }
  12. //===== eAthena Script ======================================
  13. //= Private MVP/Branch Room
  14. //===== By: ===============================================
  15. //= by ~AnnieRuru~
  16. //===== Current Version: ======================================
  17. //= 1.3
  18. //===== Compatible With: =====================================
  19. //= eAthena 11650 Trunk above or 11863 Stable above
  20. //===== Description: =========================================
  21. //= Player can rent MVP room for the player him/herself, for party or for guilds
  22. //===== Topic =================================================
  23. //= http://www.eathena.ws/board/index.php?showtopic=187654
  24. //===== Additional Comments: ==================================
  25. //= 1.0
  26. //= ---- break the tradition which a script only for a player, or only for a party.
  27. //= now 1 room can be use for party and another room can use for guilds.
  28. //= ---- timeout feature to prevent player owns the room indefinitely,
  29. //= by create a new account and sit/@at'ing inside overnight.
  30. //= ---- can disable mvp/boss summon via configuration and becomes a branch room script.
  31. //= ---- a double check to prevent players rent all the rooms for himself.
  32. //= 1.0a
  33. //= ---- fix a critial bug that the time count too fast :D"
  34. //= 1.1
  35. //= ---- added item cost to rent or to summon
  36. //= ---- added a config to limit summoning per session
  37. //= ---- added flood control option
  38. //= 1.2
  39. //= ---- rewrite the waitingroom counter
  40. //= ---- optimize the script in a way can add custom summon group
  41. //= ---- add config to kill the monsters if the room just being left empty
  42. //= ---- add GM can kick room in use
  43. //= ---- add able to spawn in numbers
  44. //= ---- add limitspawn can configure to negative to limit spawn in that group instead of individual one
  45. //= 1.3
  46. //= ---- fix chatroom countdown issue due to rev13269
  47. //= ---- fix a bug if 2 people rent a room at same time, the later 1 will get the room
  48. //= ---- add a feature so the GM can know how long the room has rented or abandoned
  49. //========================================================
  50. // This is the shop for this Branch room IF you already enable it. Can sell whatever things you want.
  51. - shop MVP room#branch -1,604:100000,12103:1000000
  52. - script MVP Summoner -1,{
  53. goto L_Start;
  54. OnInit:
  55. getmapxy .@map$, .@x, .@y, 1;
  56. if ( .@map$ == "" ) {
  57. // Config ---------------------------------------------------------------------------------------
  58. // Time for rent a room IN MINUTES. When time out, players inside the room will kick out. Do Not set this as 0
  59. set .timeout, 30;
  60. // if the room left empty for # minutes, will be treated as give up the room. Do Not set this as 0
  61. set .nobodygiveup, 5;
  62. // NOTE : The script only search item OR zeny. if you specify item amount, then it will ask for the item. If item amount is 0, then it will ask for zeny.
  63. // the cost to rent a room
  64. set .rentitemid, 7160; // item id use for rent a room - 7160 - Private MVP
  65. set .rentitemamount, 1; // amount of items to rent a room
  66. //set .rentcost, 1000000; // otherwise, zeny cost to rent a room
  67. // limit each room can only summon 1 monster at a time. (only the Summoning option)
  68. // Turn it off (0) means the player can summon a lot of monsters as long as the player has enough zeny/item. High rate server players love the room with a lot MVPs
  69. // Turn it on (1) means the player have to kill existing monster before can summon a new one. Low rate server player prefer to take out MVP 1 by 1
  70. set .floodcontrol, 0;
  71. // if .floodcontrol is turn off, your players might experience lag if they summoned too many MVPs
  72. // so what is the maximum input to limit your players summon too many ?
  73. set .inputlimit, 30;
  74. // If the room has left over monsters while nobody in the room and the room not give up yet, shall we kill monsters in empty room ?
  75. set .killmonster, 1; // Default is yes
  76. // Options menu setting for MVP Summoner NPC.
  77. set .@menu[0], 1; // Turn Heal option On/Off
  78. set .@menu[1], 1; // Turn Group 1 summons On/Off -> MVP
  79. set .@menu[2], 1; // Turn Group 2 summons On/Off -> mini boss
  80. set .@menu[3], 0; // Turn Group 3 summons On/Off
  81. set .@menu[4], 1; // Turn Group 4 summons On/Off -> Lighthalzen mobs
  82. set .@menu[5], 0; // Turn Group 5 summons On/Off
  83. set .@menu[6], 0; // Turn Group 6 summons On/Off
  84. set .@menu[7], 0; // Turn Group 7 summons On/Off
  85. set .@menu[8], 0; // Turn Group 8 summons On/Off
  86. set .@menu[9], 0; // Turn Group 9 summons On/Off
  87. set .@menu[10], 0; // Sell shop items options On/Off ( shop npc above )
  88. // set respawn point when they leave the room. Obviously warp to the Private MVP Room Warper npc
  89. set .respawnmap$, "prontera"; // Note : "SavePoint" does NOT work
  90. set .respawnx, 196;
  91. set .respawny, 151;
  92. // The minimum GM level can kick a room in use
  93. set .gmlvlkick, 80;
  94. // .limitspawn in previous revision changed to .grouplimit .
  95. // it is for limit each monster spawn per session, prevent them only killing same monster again and again
  96. // Now you can configure one group has limited summon, and another group has unlimited summon
  97. // Tips: if you server has an insane custom MVP, you can put your custom mob to Group 3~9 with insane item cost, and limit only 1 summon per session
  98. // .grouplimit use amount, means if group1limit set to 10, then each session can only summon up to 10 amount of that kind of monster. 0 is unlimited
  99. // ---------
  100. // Group 1 -> MVP
  101. // ---------
  102. set .group1name$, "MVP"; // Group 1 name
  103. set .group1itemid, 0; // item id use for summon any Group 1 monster - 674 - mithil coin
  104. set .group1itemamount, 0; // amount of items to summon a Group 1 monster
  105. set .group1cost, 50000000; // if no item is specify, zeny cost to summon a Group 1 monster
  106. set .group1limit, 2; // limit of summon of Group 1 monster per session, prevent them only killing same monster again and again
  107. setarray .group1id,
  108. 1511,// Amon Ra
  109. 1785,// Atroce
  110. 1630,// Bacsojin
  111. 1039,// Baphomet
  112. 1874,// Beelzebub
  113. 1272,// Dark Lord
  114. 1719,// Datale
  115. 1046,// Doppelgangger
  116. 1389,// Dracula
  117. 1112,// Drake
  118. 1115,// Eddga
  119. 1418,// Evil Snake Lord
  120. 1871,// Fallen Bishop
  121. 1252,// Garm
  122. 1768,// Gloom Under Night
  123. 1086,// Golden Thief Bug
  124. 1885,// Gorynych
  125. 1832,// Ifrit
  126. 1492,// Incantation Samurai
  127. 1734,// Kiel D-01
  128. 1251,// Knight of Windstorm
  129. 1779,// Ktullanux
  130. 1688,// Lady Tanee
  131. 1373,// Lord of Death
  132. 1147,// Maya
  133. 1059,// Mistress
  134. 1150,// Moonlight Flower
  135. 1087,// Orc Hero
  136. 1190,// Orc Lord
  137. 1038,// Osiris
  138. 1157,// Pharaoh
  139. 1159,// Phreeoni
  140. 1623,// RSX 0806
  141. 1583,// Tao Gunka
  142. 1312,// Turtle General
  143. 1751;// Valkyrie Randgris
  144. // ---------
  145. // Group 2 -> mini boss
  146. // ---------
  147. set .group2name$, "mini boss"; // Group 2 name
  148. set .group2itemid, 0; // item id use for summon any Group 2 monster - 674 - mithil coin
  149. set .group2itemamount, 0; // amount of items to summon a Group 2 monster
  150. set .group2cost, 10000000; // if no item is specify, zeny cost to summon a Group 2 monster
  151. set .group2limit, 1; // limit of summon of Group 2 monster per session, prevent them only killing same monster again and again
  152. setarray .group2id,
  153. 1096,// Angeling
  154. 1388,// Archangeling
  155. 1795,// Bloody Knight
  156. 1839,// Byorgue
  157. 1283,// Chimera
  158. 1302,// Dark Illusion
  159. 1582,// Deviling
  160. 1091,// Dragon Fly
  161. 1093,// Eclipse
  162. 1783,// Galion
  163. 1120,// Ghostring
  164. 1259,// Gryphon
  165. 1720,// Hydro
  166. 1090,// Mastering
  167. 1289,// Maya Purple
  168. 1262,// Mutant Dragon
  169. 1870,// Necromancer
  170. 1295,// Owl Baron
  171. 1089,// Toad
  172. 1092;// Vagabond Wolf
  173. // ---------
  174. // Group 3
  175. // ---------
  176. set .group3name$, "Poring-Family"; // Group 3 name
  177. set .group3itemid, 12109; // item id use for summon any Group 3 monster - 12109 - Poring box
  178. set .group3itemamount, 1; // amount of items to summon a Group 3 monster
  179. set .group3cost, 0; // if no item is specify, zeny cost to summon a Group 3 monster
  180. set .group3limit, -5; // limit of summon of Group 3 monster per session, prevent them only killing same monster again and again
  181. setarray .group3id,
  182. 1002,// Poring
  183. 1113,// Drops
  184. 1031,// Poporing
  185. 1242,// Marin
  186. 1062,// Santa Poring
  187. 1613,// Metaling
  188. 1784,// Stapo
  189. 1090,// Mastering
  190. 1096,// Angeling
  191. 1120,// Ghostring
  192. 1582,// Deviling
  193. 1388;// Arc Angeling
  194. // ---------
  195. // Group 4
  196. // ---------
  197. set .group4name$, "Lighthalzen mobs"; // Group 4 name
  198. set .group4itemid, 0; // item id use for summon any Group 4 monster
  199. set .group4itemamount, 1; // amount of items to summon a Group 4 monster
  200. set .group4cost, 200000000; // if no item is specify, zeny cost to summon a Group 4 monster
  201. set .group4limit, 1; // limit of summon of Group 4 monster per session, prevent them only killing same monster again and again
  202. setarray .group4id,
  203. 1647,// Assassin Cross Eremes
  204. 1651,// High Wizard Katrinn
  205. 1646,// Lord Knight Seyren
  206. 1650,// Sniper Shecil
  207. 1648;// Whitesmith Harword
  208.  
  209. // ---------
  210. // Group 5
  211. // ---------
  212. set .group5name$, ""; // Group 5 name
  213. set .group5itemid, 0; // item id use for summon any Group 5 monster
  214. set .group5itemamount, 0; // amount of items to summon a Group 5 monster
  215. set .group5cost, 0; // if no item is specify, zeny cost to summon a Group 5 monster
  216. set .group5limit, 0; // limit of summon of Group 5 monster per session, prevent them only killing same monster again and again
  217. setarray .group5id,
  218. 1001,
  219. 1002;
  220. // ---------
  221. // Group 6
  222. // ---------
  223. set .group6name$, ""; // Group 6 name
  224. set .group6itemid, 0; // item id use for summon any Group 6 monster
  225. set .group6itemamount, 0; // amount of items to summon a Group 6 monster
  226. set .group6cost, 0; // if no item is specify, zeny cost to summon a Group 6 monster
  227. set .group6limit, 0; // limit of summon of Group 6 monster per session, prevent them only killing same monster again and again
  228. setarray .group6id,
  229. 1001,
  230. 1002;
  231. // ---------
  232. // Group 7
  233. // ---------
  234. set .group7name$, ""; // Group 7 name
  235. set .group7itemid, 0; // item id use for summon any Group 7 monster
  236. set .group7itemamount, 0; // amount of items to summon a Group 7 monster
  237. set .group7cost, 0; // if no item is specify, zeny cost to summon a Group 7 monster
  238. set .group7limit, 0; // limit of summon of Group 7 monster per session, prevent them only killing same monster again and again
  239. setarray .group7id,
  240. 1001,
  241. 1002;
  242. // ---------
  243. // Group 8
  244. // ---------
  245. set .group8name$, ""; // Group 8 name
  246. set .group8itemid, 0; // item id use for summon any Group 8 monster
  247. set .group8itemamount, 0; // amount of items to summon a Group 8 monster
  248. set .group8cost, 0; // if no item is specify, zeny cost to summon a Group 8 monster
  249. set .group8limit, 0; // limit of summon of Group 8 monster per session, prevent them only killing same monster again and again
  250. setarray .group8id,
  251. 1001,
  252. 1002;
  253. // ---------
  254. // Group 9
  255. // ---------
  256. set .group9name$, ""; // Group 9 name
  257. set .group9itemid, 0; // item id use for summon any Group 9 monster
  258. set .group9itemamount, 0; // amount of items to summon a Group 9 monster
  259. set .group9cost, 0; // if no item is specify, zeny cost to summon a Group 9 monster
  260. set .group9limit, 0; // limit of summon of Group 9 monster per session, prevent them only killing same monster again and again
  261. setarray .group9id,
  262. 1001,
  263. 1002;
  264. // Config Ends ------------------------------------------------------------------------
  265. if ( .timeout == 0 ) set .timeout, 60;
  266. if ( .nobodygiveup == 0 ) set .nobodygiveup, 5;
  267. if ( .inputlimit < 1 ) set .inputlimit, 1;
  268. if ( .rentitemid && .rentitemamount ) {
  269. if ( getitemname(.rentitemid) == "null" ) {
  270. debugmes "Private MVP Room: Rent a room is using invalid item id.";
  271. }
  272. }
  273. set .@i, 1;
  274. while ( .@i <= 9 ) {
  275. if ( .@menu[.@i] && getd(".group"+ .@i +"itemid") && getd(".group"+ .@i +"itemamount") ) {
  276. if ( getitemname( getd(".group"+ .@i +"itemid") ) == "null" ) {
  277. debugmes "Private MVP Room: Group no. "+ .@i +" is using invalid item id.";
  278. }
  279. }
  280. set .@i, .@i +1 ;
  281. }
  282. set .menu$, ( (.@menu[0])?"Heal":"" )+":"+( (.@menu[1])?"Summon "+ .group1name$:"" )+":"+( (.@menu[2])?"Summon "+ .group2name$:"" )+":"+( (.@menu[3])?"Summon "+ .group3name$:"" )+":"+( (.@menu[4])?"Summon "+ .group4name$:"" )+":"+( (.@menu[5])?"Summon "+ .group5name$:"" )+":"+( (.@menu[6])?"Summon "+ .group6name$:"" )+":"+( (.@menu[7])?"Summon "+ .group7name$:"" )+":"+( (.@menu[8])?"Summon "+ .group8name$:"" )+":"+( (.@menu[9])?"Summon "+ .group9name$:"" )+":"+( (.@menu[10])?"Buy branches":"" )+":Leave this room:Give up this room";
  283. set .@i, 1;
  284. while ( .@i <= 9 ) {
  285. setd ".group"+ .@i +"idsize", getarraysize( getd(".group"+ .@i +"id") );
  286. if ( .@menu[.@i] && getd(".group"+ .@i +"limit") <= 0 ) {
  287. set .@j, 0;
  288. while ( .@j < getd(".group"+ .@i +"idsize") ) {
  289. setd ".group"+ .@i +"menu$", getd(".group"+ .@i +"menu$") + getmonsterinfo( getd(".group"+ .@i +"id["+ .@j +"]"), 0) +":";
  290. set .@j, .@j +1 ;
  291. }
  292. }
  293. set .@i, .@i +1 ;
  294. }
  295. }
  296. else {
  297. sleep 1;
  298. mapannounce .@map$, "Admin has refresh the server, please register the room again.", 1;
  299. mapwarp .@map$, .respawnmap$, .respawnx, .respawny;
  300. }
  301. end;
  302. L_Start: // I hate gotos ... but ...
  303. set .@dif, strnpcinfo(2);
  304. if ( .remind[.@dif] == 0 ) {
  305. set .remind[.@dif], 1;
  306. initnpctimer;
  307. }
  308. mes "[MVP Summoner]";
  309. mes "Hi, what can I do for you ?";
  310. next;
  311. switch ( select(.menu$) ) {
  312. case 1:
  313. mes "[MVP Summoner]";
  314. if ( getmapmobs("this") > 0 ) {
  315. mes "I cannot offer heal service when there are monsters around.";
  316. close;
  317. }
  318. sc_end sc_stone;
  319. sc_end sc_slowdown;
  320. sc_end sc_freeze;
  321. sc_end sc_sleep;
  322. sc_end sc_curse;
  323. sc_end sc_silence;
  324. sc_end sc_confusion;
  325. sc_end sc_blind;
  326. sc_end sc_bleeding;
  327. sc_end sc_decreaseagi;
  328. sc_end sc_poison;
  329. sc_end sc_hallucination;
  330. sc_end sc_stripweapon;
  331. sc_end sc_striparmor;
  332. sc_end sc_striphelm;
  333. sc_end sc_stripshield;
  334. sc_end sc_changeundead;
  335. sc_end sc_orcish;
  336. sc_end sc_berserk;
  337. sc_end sc_ske;
  338. sc_end sc_swoo;
  339. sc_end sc_ska;
  340. percentheal 100,100;
  341. specialeffect2 7;
  342. mes "You have completely healed.";
  343. close;
  344. default:
  345. set .@group, @menu -1;
  346. if ( .floodcontrol && getmapmobs("this") > 0 ) {
  347. mes "[MVP Summoner]";
  348. mes "I cannot summon another monster when there are monsters around.";
  349. close;
  350. }
  351. else if ( getd(".group"+ .@group +"itemid") && getd(".group"+ .@group +"itemamount") ) {
  352. mes "[MVP Summoner]";
  353. mes "The cost to summon a "+ getd(".group"+ .@group +"name$") +" is "+ getd(".group"+ .@group +"itemamount") +" "+ getitemname( getd(".group"+ .@group +"itemid") ) +".";
  354. if ( getd(".group"+ .@group +"limit") < 0 )
  355. mes "("+( ( ~getd(".group"+ .@group +"limit")+1 - getd(".group"+ .@group +"limit"+ .@dif) <= 0 )?0:( ~getd(".group"+ .@group +"limit")+1 - getd(".group"+ .@group +"limit"+ .@dif) ) )+") more summons for this group.";
  356. next;
  357. }
  358. else if ( getd(".group"+ .@group +"cost") ) {
  359. mes "[MVP Summoner]";
  360. mes "The cost to summon a "+ getd(".group"+ .@group +"name$") +" is "+ callfunc("int__", getd(".group"+ .@group +"cost") ) +" zeny.";
  361. if ( getd(".group"+ .@group +"limit") < 0 )
  362. mes "("+( ( ~getd(".group"+ .@group +"limit")+1 - getd(".group"+ .@group +"limit"+ .@dif) <= 0 )?0:( ~getd(".group"+ .@group +"limit")+1 - getd(".group"+ .@group +"limit"+ .@dif) ) )+") more summons for this group.";
  363. next;
  364. }
  365. else if ( getd(".group"+ .@group +"limit") < 0 ) {
  366. mes "[MVP Summoner]";
  367. mes "("+( ( ~getd(".group"+ .@group +"limit")+1 - getd(".group"+ .@group +"limit"+ .@dif) <= 0 )?0:( ~getd(".group"+ .@group +"limit")+1 - getd(".group"+ .@group +"limit"+ .@dif) ) )+") more summons for this group.";
  368. next;
  369. }
  370. if ( getd(".group"+ .@group +"limit") < 0 && getd(".group"+ .@group +"limit"+ .@dif) >= ~getd(".group"+ .@group +"limit")+1 ) {
  371. mes "[MVP Summoner]";
  372. mes "I'm sorry, but you can't summon any more monster for this group.";
  373. close;
  374. }
  375. else if ( getd(".group"+ .@group +"limit") > 0 ) {
  376. for ( set .@i, 0; .@i < getd(".group"+ .@group +"idsize"); set .@i, .@i +1 )
  377. set .@menu$, .@menu$ +( ( getd(".group"+ .@group +"limit"+ .@dif +"["+ .@i +"]") >= getd(".group"+ .@group +"limit") )?"^999999":"^000000" )+ getmonsterinfo( getd(".group"+ .@group +"id["+ .@i +"]"), 0) +" ("+ ( ( getd(".group"+ .@group +"limit") - getd(".group"+ .@group +"limit"+ .@dif +"["+ .@i +"]") <= 0 )?0:( getd(".group"+ .@group +"limit") - getd(".group"+ .@group +"limit"+ .@dif +"["+ .@i +"]") ) ) +")"+":";
  378. set .@menu, select(.@menu$) -1;
  379. }
  380. else
  381. set .@menu, select( getd(".group"+ .@group +"menu$") ) -1;
  382. mes "[MVP Summoner]";
  383. if ( .floodcontrol == 0 && .inputlimit > 1 ) {
  384. mes "Input an amount of monsters to summon.";
  385. next;
  386. input .@amount;
  387. if ( .@amount == 0 ) close;
  388. else if ( .@amount > .inputlimit )
  389. set .@amount, .inputlimit;
  390. mes "[MVP Summoner]";
  391. }
  392. else
  393. set .@amount, 1;
  394. if ( getd(".group"+ .@group +"itemid") && getd(".group"+ .@group +"itemamount") ) {
  395. if ( countitem( getd(".group"+ .@group +"itemid") ) < getd(".group"+ .@group +"itemamount") * .@amount ) {
  396. mes "You don't have enough "+ getitemname( getd(".group"+ .@group +"itemid") ) +" to summon a "+ getd(".group"+ .@group +"name$") +".";
  397. close;
  398. }
  399. }
  400. else if ( getd(".group"+ .@group +"cost") ) {
  401. if ( zeny < getd(".group"+ .@group +"cost") * .@amount ) {
  402. mes "You don't have enough zeny to summon a "+ getd(".group"+ .@group +"name$") +".";
  403. close;
  404. }
  405. }
  406. if ( .floodcontrol && getmapmobs("this") > 0 ) {
  407. mes "I cannot summon another monster when there are monsters around.";
  408. close;
  409. }
  410. else if ( getd(".group"+ .@group +"limit") > 0 ) {
  411. if ( getd(".group"+ .@group +"limit"+ .@dif +"["+ .@menu +"]") >= getd(".group"+ .@group +"limit") ) {
  412. mes "I'm sorry, but you already summoned that monster too much. Try summon another.";
  413. close;
  414. }
  415. else if ( getd(".group"+ .@group +"limit"+ .@dif +"["+ .@menu +"]") + .@amount > getd(".group"+ .@group +"limit") ) {
  416. mes "The amount you input is more than the limit you can summon. Try reduce the amount.";
  417. close;
  418. }
  419. }
  420. else if ( getd(".group"+ .@group +"limit") < 0 ) {
  421. if ( getd(".group"+ .@group +"limit"+ .@dif) >= ~getd(".group"+ .@group +"limit")+1 ) {
  422. mes "I'm sorry, but you can't summon any more monster for this group.";
  423. close;
  424. }
  425. else if ( getd(".group"+ .@group +"limit"+ .@dif) + .@amount > ~getd(".group"+ .@group +"limit")+1 ) {
  426. mes "The amount you input is more than the limit you can summon. Try reduce the amount.";
  427. close;
  428. }
  429. }
  430. mes "Summoning "+ .@amount +" "+ getmonsterinfo( getd(".group"+ .@group +"id["+ .@menu +"]"), 0) +".";
  431. mes "Ok, get ready ?";
  432. close2;
  433. if ( .floodcontrol && getmapmobs("this") > 0 ) end;
  434. if ( getd(".group"+ .@group +"itemid") && getd(".group"+ .@group +"itemamount") ) {
  435. if ( countitem( getd(".group"+ .@group +"itemid") ) < getd(".group"+ .@group +"itemamount") * .@amount ) end;
  436. delitem getd(".group"+ .@group +"itemid"), getd(".group"+ .@group +"itemamount") * .@amount;
  437. }
  438. else if ( getd(".group"+ .@group +"cost") ) {
  439. if ( zeny < getd(".group"+ .@group +"cost") * .@amount ) end;
  440. set zeny, zeny - getd(".group"+ .@group +"cost") * .@amount;
  441. }
  442. if ( getd(".group"+ .@group +"limit") > 0 ) {
  443. if ( getd(".group"+ .@group +"limit"+ .@dif +"["+ .@menu +"]") + .@amount > getd(".group"+ .@group +"limit") ) end;
  444. setd ".group"+ .@group +"limit"+ .@dif +"["+ .@menu +"]", getd(".group"+ .@group +"limit"+ .@dif +"["+ .@menu +"]") + .@amount;
  445. }
  446. else if ( getd(".group"+ .@group +"limit") < 0 ) {
  447. if ( getd(".group"+ .@group +"limit"+ .@dif) + .@amount > ~getd(".group"+ .@group +"limit")+1 ) end;
  448. setd ".group"+ .@group +"limit"+ .@dif, getd(".group"+ .@group +"limit"+ .@dif) + .@amount;
  449. }
  450. monster "this", 0, 0, "--ja--", getd(".group"+ .@group +"id["+ .@menu +"]"), .@amount;
  451. end;
  452. case 11:
  453. if ( getmapmobs("this") > 0 ) {
  454. mes "[MVP Summoner]";
  455. mes "I cannot offer this service when there are monsters around.";
  456. close;
  457. }
  458. close2;
  459. callshop "MVP room#branch", 0;
  460. end;
  461. case 12:
  462. mes "[MVP Summoner]";
  463. mes "Are you sure you want to leave this room ?";
  464. mes "If this room left empty for more than "+ .nobodygiveup +" minutes, you lost ownership for this room.";
  465. if ( select( "Yes:No") == 2 ) close;
  466. warp .respawnmap$, .respawnx, .respawny;
  467. end;
  468. case 13:
  469. mes "[MVP Summoner]";
  470. getmapxy .@map$, .@x, .@y, 0;
  471. if ( getmapusers(.@map$) > 1 ) {
  472. mes "There are still some players in this room. Make sure you are the last member in this room to use this option.";
  473. close;
  474. }
  475. mes "Are you sure you want to give up this room ?";
  476. if ( .rentcost )
  477. mes "You will need to pay again to enter this room.";
  478. next;
  479. if ( select( "Yes:No" ) == 2 ) close;
  480. warp .respawnmap$, .respawnx, .respawny;
  481. set .remaintime[.@dif], -1;
  482. end;
  483. }
  484. close;
  485. OnEnterMap:
  486. set .@dif, strnpcinfo(2);
  487. set .remind[.@dif], 0;
  488. for ( set .@i, 1; .@i <= 9; set .@i, .@i +1 )
  489. deletearray getd(".group"+ .@i +"limit"+ .@dif), getd(".group"+ .@i +"idsize");
  490. set .nobodycounter[.@dif], 0;
  491. getmapxy .@map$, .@x, .@y ,1;
  492. set .starttime[.@dif], gettimetick(2);
  493. do {
  494. set .remaintime[.@dif], .timeout * 60 + .starttime[.@dif] - gettimetick(2);
  495. set .@hour[.@dif], .remainTime[.@dif] / 3600 ;
  496. set .@min[.@dif], .remainTime[.@dif] % 3600 / 60 ;
  497. set .@sec[.@dif], .remainTime[.@dif] % 3600 % 60 ;
  498. delwaitingroom strnpcinfo(0);
  499. waitingroom "Time Left = "+( ( .@hour[.@dif] )?( .@hour[.@dif] +":"):"" )+( ( .@min[.@dif] < 10 )?"0"+ .@min[.@dif]: .@min[.@dif] )+":"+( ( .@sec[.@dif] < 10 )?"0"+ .@sec[.@dif]: .@sec[.@dif] ), 0;
  500. if ( getmapusers(.@map$) )
  501. set .nobodycounter[.@dif], 0;
  502. else {
  503. set .nobodycounter[.@dif], .nobodycounter[.@dif] +1 ;
  504. if ( .nobodycounter[.@dif] > .nobodygiveup * 60 ) break;
  505. }
  506. sleep 995;
  507. } while ( .remaintime[.@dif] > 1 );
  508. set .remaintime[.@dif], 0;
  509. delwaitingroom "MVP Summoner#"+ .@dif;
  510. mapwarp .@map$, .respawnmap$, .respawnx, .respawny;
  511. end;
  512. OnTimer100:
  513. stopnpctimer;
  514. npctalk "Hi ~ the bubble above my head is the countdown for using this room.";
  515. sleep 2000;
  516. npctalk "Sometimes, I can skip for about 1 second in the countdown.";
  517. sleep 3000;
  518. npctalk "That is because the server is experiencing minor lag problem.";
  519. sleep 3000;
  520. npctalk "So, don't complain about me cheated for the countdown ~ ^.^";
  521. sleep 3000;
  522. npctalk "Have a nice day ~";
  523. end;
  524. }
  525. prontera,203,178,5 script Private MVP Room 100,{
  526. mes "[Private MVP Room]";
  527. mes "Please select a private MVP room.";
  528. next;
  529. mes "^61B031[" + strcharinfo(0) + "]^000000";
  530. mes " ";
  531. mes " ";
  532. mes "i need ^61B031PRIVATE MVP Vouncher^000000";
  533. if ( getvariableofnpc(.rentitemid, "MVP Summoner") && getvariableofnpc(.rentitemamount, "MVP Summoner") )
  534. mes "The cost to rent a room for "+ getvariableofnpc(.timeout, "MVP Summoner") +" minutes is "+ getvariableofnpc(.rentitemamount, "MVP Summoner") +" "+ getitemname( getvariableofnpc(.rentitemid, "MVP Summoner") ) +".";
  535. else if ( getvariableofnpc(.rentcost, "MVP Summoner") )
  536. mes "The cost to rent a room for "+ getvariableofnpc(.timeout, "MVP Summoner") +" minutes is "+ callfunc("int__", getvariableofnpc(.rentcost, "MVP Summoner") ) +" zeny.";
  537. else
  538. mes "You can only use the room for only "+ getvariableofnpc(.timeout, "MVP Summoner") +" minutes.";
  539. mes " ";
  540. for ( set .@i, 1; .@i <= 8; set .@i, .@i +1 ) {
  541. if ( getvariableofnpc(.remaintime[.@i],"MVP Summoner") ) {
  542. switch ( .type[.@i] ) {
  543. case 1: set .@color$, "^EE8800"; break;
  544. case 2: set .@color$, "^70CC11"; break;
  545. case 3: set .@color$, "^0000FF"; break;
  546. default: set .@color$, "^000000";
  547. }
  548. mes "Room #"+ .@i +" = "+ .@color$ + .whoinuse$[.@i] +"^000000";
  549. }
  550. }
  551. next;
  552. set .@room, select("MVP Room 1 ["+ getmapusers("06guild_01") +"]",
  553. "MVP Room 2 ["+ getmapusers("06guild_02") +"]",
  554. "MVP Room 3 ["+ getmapusers("06guild_03") +"]",
  555. "MVP Room 4 ["+ getmapusers("06guild_04") +"]",
  556. "MVP Room 5 ["+ getmapusers("06guild_05") +"]",
  557. "MVP Room 6 ["+ getmapusers("06guild_06") +"]",
  558. "MVP Room 7 ["+ getmapusers("06guild_07") +"]",
  559. "MVP Room 8 ["+ getmapusers("06guild_08") +"]");
  560. if ( getvariableofnpc(.remaintime[.@room],"MVP Summoner") ) {
  561. if ( .inuseid[.@room] == getcharid(.type[.@room]) ) {
  562. if ( getvariableofnpc(.killmonster,"MVP Summoner") && getmapusers("06guild_0"+ .@room) == 0 )
  563. killmonsterall "06guild_0"+ .@room;
  564. warp "06guild_0"+ .@room, 0,0;
  565. end;
  566. } else {
  567. mes "[Private MVP Room]";
  568. switch ( .type[.@room] ) {
  569. case 1: set .@color$, "^EE8800Party "; break;
  570. case 2: set .@color$, "^70CC11Guild "; break;
  571. case 3: set .@color$, "^0000FFPlayer ";
  572. }
  573. mes "This room is reserved for ";
  574. mes .@color$ + .whoinuse$[.@room] +"^000000 .";
  575. if ( getgmlevel() < getvariableofnpc(.gmlvlkick,"MVP Summoner") ) {
  576. mes "Please select another.";
  577. close;
  578. }
  579. mes " ";
  580. mes "Currently there are "+ getmapusers("06guild_0"+ .@room) +" players";
  581. mes "in that room.";
  582. set .@remaintime, getvariableofnpc(.remaintime[.@room],"MVP Summoner");
  583. mes "It still has "+( .@remaintime /60 )+"mn "+( .@remaintime %60 )+"s left.";
  584. set .@nobodycounter, getvariableofnpc(.nobodycounter[.@room],"MVP Summoner");
  585. if ( .@nobodycounter )
  586. mes "And have left empty for "+( .@nobodycounter /60 )+"mn "+( .@nobodycounter %60 )+"s.";
  587. mes "Kick them ?";
  588. next;
  589. if ( select ( "No:Yes" ) == 1 ) close;
  590. set getvariableofnpc(.remaintime[.@room],"MVP Summoner"), -1;
  591. mes "[Private MVP Room]";
  592. mes "Room#"+ .@room +" is empty now.";
  593. close;
  594. }
  595. }
  596. mes "[Private MVP Room]";
  597. if ( getvariableofnpc(.rentitemid, "MVP Summoner") && getvariableofnpc(.rentitemamount, "MVP Summoner") ) {
  598. if ( countitem(getvariableofnpc(.rentitemid, "MVP Summoner")) < getvariableofnpc(.rentitemamount, "MVP Summoner") ) {
  599. mes "You don't have enough "+ getitemname( getvariableofnpc(.rentitemid, "MVP Summoner") ) +" to rent a room.";
  600. close;
  601. }
  602. }
  603. else if ( getvariableofnpc(.rentcost, "MVP Summoner") ) {
  604. if ( zeny < getvariableofnpc(.rentcost, "MVP Summoner") ) {
  605. mes "You don't have enough zeny to rent a room.";
  606. close;
  607. }
  608. }
  609. mes "You reserve this room for ...";
  610. next;
  611. set .@type, select("For my party members", "For my guild members", "For personal account use" );
  612. if ( getcharid(.@type) == 0 ) {
  613. mes "[Private MVP Room]";
  614. mes "You do not own a "+( (.@type == 1)?"Party":"Guild" )+".";
  615. close;
  616. }
  617. else if ( getvariableofnpc(.remaintime[.@room],"MVP Summoner") ) {
  618. mes "[Private MVP Room]";
  619. mes "I'm sorry, somebody else has already register this room faster than you.";
  620. close;
  621. }
  622. for ( set .@i, 1; .@i <= 8; set .@i, .@i +1 ) {
  623. if ( getvariableofnpc(.remaintime[.@i],"MVP Summoner") && .@type == .type[.@i] && getcharid(.@type) == .inuseid[.@i] ) {
  624. mes "[Private MVP Room]";
  625. mes "You already rented Room#"+ .@i +". Use that room instead.";
  626. close;
  627. }
  628. }
  629. set .type[.@room], .@type;
  630. set .inuseid[.@room], getcharid(.@type);
  631. set .whoinuse$[.@room], strcharinfo( (.@type == 3)?0:.@type );
  632. if ( getvariableofnpc(.rentitemid, "MVP Summoner") && getvariableofnpc(.rentitemamount, "MVP Summoner") ) {
  633. if ( countitem(getvariableofnpc(.rentitemid, "MVP Summoner")) < getvariableofnpc(.rentitemamount, "MVP Summoner") ) end;
  634. delitem getvariableofnpc(.rentitemid, "MVP Summoner"), getvariableofnpc(.rentitemamount, "MVP Summoner");
  635. }
  636. else if ( getvariableofnpc(.rentcost, "MVP Summoner") ) {
  637. if ( zeny < getvariableofnpc(.rentcost, "MVP Summoner") ) end;
  638. set zeny, zeny - getvariableofnpc(.rentcost, "MVP Summoner");
  639. }
  640. warp "06guild_0"+ .@room, 0,0;
  641. killmonsterall "06guild_0"+ .@room;
  642. donpcevent "MVP Summoner#"+ .@room +"::OnEnterMap";
  643. end;
  644. }
  645. 06guild_01,49,49,4 duplicate(MVP Summoner) MVP Summoner#1 116
  646. 06guild_02,49,49,4 duplicate(MVP Summoner) MVP Summoner#2 116
  647. 06guild_03,49,49,4 duplicate(MVP Summoner) MVP Summoner#3 116
  648. 06guild_04,49,49,4 duplicate(MVP Summoner) MVP Summoner#4 116
  649. 06guild_05,49,49,4 duplicate(MVP Summoner) MVP Summoner#5 116
  650. 06guild_06,49,49,4 duplicate(MVP Summoner) MVP Summoner#6 116
  651. 06guild_07,49,49,4 duplicate(MVP Summoner) MVP Summoner#7 116
  652. 06guild_08,49,49,4 duplicate(MVP Summoner) MVP Summoner#8 116
  653. 06guild_01 mapflag nowarpto
  654. 06guild_02 mapflag nowarpto
  655. 06guild_03 mapflag nowarpto
  656. 06guild_04 mapflag nowarpto
  657. 06guild_05 mapflag nowarpto
  658. 06guild_06 mapflag nowarpto
  659. 06guild_07 mapflag nowarpto
  660. 06guild_08 mapflag nowarpto
  661. 06guild_01 mapflag nomemo
  662. 06guild_02 mapflag nomemo
  663. 06guild_03 mapflag nomemo
  664. 06guild_04 mapflag nomemo
  665. 06guild_05 mapflag nomemo
  666. 06guild_06 mapflag nomemo
  667. 06guild_07 mapflag nomemo
  668. 06guild_08 mapflag nomemo
  669. 06guild_01 mapflag noteleport
  670. 06guild_02 mapflag noteleport
  671. 06guild_03 mapflag noteleport
  672. 06guild_04 mapflag noteleport
  673. 06guild_05 mapflag noteleport
  674. 06guild_06 mapflag noteleport
  675. 06guild_07 mapflag noteleport
  676. 06guild_08 mapflag noteleport
  677. 06guild_01 mapflag nosave SavePoint
  678. 06guild_02 mapflag nosave SavePoint
  679. 06guild_03 mapflag nosave SavePoint
  680. 06guild_04 mapflag nosave SavePoint
  681. 06guild_05 mapflag nosave SavePoint
  682. 06guild_06 mapflag nosave SavePoint
  683. 06guild_07 mapflag nosave SavePoint
  684. 06guild_08 mapflag nosave SavePoint
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement