Advertisement
Guest User

Untitled

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