Advertisement
Guest User

Untitled

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