Advertisement
Guest User

~AnnieRuru~ private mvp/branch room

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