Advertisement
Guest User

Untitled

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