Advertisement
Guest User

All_MvP

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