Advertisement
Guest User

Untitled

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