Advertisement
Guest User

MVP

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