mvp_room.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. //===== rAthena Script =======================================
  2. //= Private MVP & Branch Room
  3. //===== By: ==================================================
  4. //= AnnieRuru
  5. //===== Current Version: =====================================
  6. //= 1.0
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= Allows players to rent an MVP room for personal use,
  11. //= or for a party or guild.
  12. //===== Additional Comments: =================================
  13. //= 1.0 First version, edited. [Euphy]
  14. //============================================================
  15. prontera,148,174,5 script Private MVP Room 100,{
  16. mes "[Private MVP Room]";
  17. mes "Please select a private MVP room.";
  18. if ( getvariableofnpc( .rentcost, "MVP Summoner" ) )
  19. mes "The cost to rent a room for "+ getvariableofnpc( .timeout, "MVP Summoner" ) +" minutes is "+ callfunc("F_InsertComma", getvariableofnpc( .rentcost, "MVP Summoner" ) ) +" zeny.";
  20. else
  21. mes "You can only use the room for only "+ getvariableofnpc( .timeout, "MVP Summoner" ) +" minutes.";
  22. mes " ";
  23. for ( .@i = 1; .@i <= 8; .@i++ )
  24. if ( getvariableofnpc( .renttime[.@i], "MVP Summoner" ) )
  25. mes "Room #"+ .@i +" = "+ .color$[ .type[.@i] ] + .whoinuse$[.@i] +"^000000";
  26. next;
  27. .@room = select(
  28. "MVP Room 1 ["+ getmapusers("06guild_01") +"]",
  29. "MVP Room 2 ["+ getmapusers("06guild_02") +"]",
  30. "MVP Room 3 ["+ getmapusers("06guild_03") +"]",
  31. "MVP Room 4 ["+ getmapusers("06guild_04") +"]",
  32. "MVP Room 5 ["+ getmapusers("06guild_05") +"]",
  33. "MVP Room 6 ["+ getmapusers("06guild_06") +"]",
  34. "MVP Room 7 ["+ getmapusers("06guild_07") +"]",
  35. "MVP Room 8 ["+ getmapusers("06guild_08") +"]");
  36. if ( getvariableofnpc( .renttime[.@room], "MVP Summoner" ) ) {
  37. if ( .inuseid[.@room] == getcharid( .type[.@room] ) ) {
  38. warp "06guild_0"+ .@room, 0,0;
  39. close;
  40. } else {
  41. mes "[Private MVP Room]";
  42. mes "This room is reserved for ";
  43. mes .color$[ .type[.@room] ] + .whoinuse$[.@room] +"^000000.";
  44. mes "Please select another.";
  45. close;
  46. }
  47. }
  48. mes "[Private MVP Room]";
  49. mes "Reserve this room for...";
  50. next;
  51. set .@type, select( "For my party members", "For my guild members", "For personal account use" );
  52. if ( !getcharid(.@type) ) {
  53. mes "[Private MVP Room]";
  54. mes "You do not own a "+( ( .@type == 1 )? "Party" : "Guild" )+".";
  55. close;
  56. }
  57. else if ( Zeny < getvariableofnpc( .rentcost, "MVP Summoner" ) ) {
  58. mes "You don't have enough zeny to rent a room.";
  59. close;
  60. }
  61. else if ( getvariableofnpc( .renttime[.@room], "MVP Summoner" ) ) {
  62. mes "[Private MVP Room]";
  63. mes "I'm sorry, somebody else has already registered this room faster than you.";
  64. close;
  65. }
  66. for ( .@i = 1; .@i <= 8; .@i++ ) {
  67. if ( ( getvariableofnpc( .renttime[.@i], "MVP Summoner" ) ) && .@type == .type[.@i] && getcharid(.@type) == .inuseid[.@i] ) {
  68. mes "[Private MVP Room]";
  69. mes "You already rented Room#"+ .@i +". Use that room instead.";
  70. close;
  71. }
  72. }
  73. set .type[.@room], .@type;
  74. set .inuseid[.@room], getcharid(.@type);
  75. set .whoinuse$[.@room], strcharinfo( ( .@type == 3 )? 0 : .@type );
  76. Zeny -= getvariableofnpc( .rentcost, "MVP Summoner" );
  77. warp "06guild_0"+ .@room, 0,0;
  78. killmonsterall "06guild_0"+ .@room;
  79. donpcevent "MVP Summoner#"+ .@room +"::OnEnterMap";
  80. close;
  81. OnInit:
  82. .color$[1] = "^EE8800"; // party color
  83. .color$[2] = "^70CC11"; // guild color
  84. .color$[3] = "^0000FF"; // account color
  85. end;
  86. }
  87. - script MVP Summoner -1,{
  88. mes "[MVP Summoner]";
  89. mes "Time left: " + callfunc( "Time2Str", .renttime[ atoi( strnpcinfo(2) ) ] + .timeout * 60 );
  90. mes "Hi, what can I do for you?";
  91. next;
  92. switch ( select(.menu$) ) {
  93. case 1:
  94. mes "[MVP Summoner]";
  95. if ( mobcount( "this", strnpcinfo(3)+"::OnMobDead" ) ) {
  96. mes "I cannot offer heal service when there are monsters around.";
  97. close;
  98. }
  99. sc_end SC_STONE;
  100. sc_end SC_SLOWDOWN;
  101. sc_end SC_FREEZE;
  102. sc_end SC_SLEEP;
  103. sc_end SC_CURSE;
  104. sc_end SC_SILENCE;
  105. sc_end SC_CONFUSION;
  106. sc_end SC_BLIND;
  107. sc_end SC_BLEEDING;
  108. sc_end SC_DECREASEAGI;
  109. sc_end SC_POISON;
  110. sc_end SC_HALLUCINATION;
  111. sc_end SC_STRIPWEAPON;
  112. sc_end SC_STRIPARMOR;
  113. sc_end SC_STRIPHELM;
  114. sc_end SC_STRIPSHIELD;
  115. sc_end SC_CHANGEUNDEAD;
  116. sc_end SC_ORCISH;
  117. sc_end SC_BERSERK;
  118. sc_end SC_SKE;
  119. sc_end SC_SWOO;
  120. sc_end SC_SKA;
  121. percentheal 100,100;
  122. specialeffect2 EF_HEAL;
  123. mes "You are completely healed.";
  124. close;
  125. case 2:
  126. if ( mobcount( "this", strnpcinfo(3)+"::OnMobDead" ) ) {
  127. mes "[MVP Summoner]";
  128. mes "I cannot summon another MVP when there are monsters around.";
  129. close;
  130. } else if ( .mvpcost ) {
  131. mes "[MVP Summoner]";
  132. mes "The cost to summon an MVP is "+ callfunc( "F_InsertComma", .mvpcost ) +" zeny.";
  133. next;
  134. set .@menu, select(.mvpid_menu$) -1;
  135. mes "[MVP Summoner]";
  136. if ( Zeny < .mvpcost ) {
  137. mes "You don't have enough zeny to summon an MVP.";
  138. close;
  139. }
  140. } else {
  141. set .@menu, select(.mvpid_menu$) -1;
  142. mes "[MVP Summoner]";
  143. }
  144. mes "Please get ready.";
  145. close2;
  146. if ( Zeny < .mvpcost ) end;
  147. Zeny -= .mvpcost;
  148. monster "this", 0, 0, "--ja--", .mvpid[.@menu], 1, strnpcinfo(3)+"::OnMobDead";
  149. end;
  150. case 3:
  151. if ( mobcount( "this", strnpcinfo(3)+"::OnMobDead" ) ) {
  152. mes "[MVP Summoner]";
  153. mes "I cannot summon another mini-boss when there are monsters around.";
  154. close;
  155. } else if ( .bosscost ) {
  156. mes "[MVP Summoner]";
  157. mes "The cost to summon a mini-boss is "+ callfunc( "F_InsertComma", .bosscost ) +" zeny.";
  158. next;
  159. set .@menu, select(.bossid_menu$) -1;
  160. mes "[MVP Summoner]";
  161. if ( Zeny < .bosscost ) {
  162. mes "You doesn't have enough zeny to summon a mini-boss.";
  163. close;
  164. }
  165. } else {
  166. set .@menu, select(.bossid_menu$) -1;
  167. mes "[MVP Summoner]";
  168. }
  169. mes "Please get ready.";
  170. close2;
  171. if ( Zeny < .bosscost ) end;
  172. Zeny -= .bosscost;
  173. monster "this", 0, 0, "--ja--", .bossid[.@menu], 1, strnpcinfo(3)+"::OnMobDead";
  174. end;
  175. case 4:
  176. if ( mobcount( "this", strnpcinfo(3)+"::OnMobDead" ) > 0 ) {
  177. mes "[MVP Summoner]";
  178. mes "I cannot offer this service when there are monsters around.";
  179. close;
  180. }
  181. close2;
  182. callshop "MVP room#branch", 1;
  183. end;
  184. case 5:
  185. mes "[MVP Summoner]";
  186. mes "Are you sure you want to leave this room?";
  187. next;
  188. if ( select( "Yes:No") == 1 )
  189. warp .respawnmap$, .respawnx, .respawny;
  190. close;
  191. case 6:
  192. mes "[MVP Summoner]";
  193. if ( getmapusers( strcharinfo(3) ) > 1 ) {
  194. mes "There are still some players in this room. Make sure you are the last member in this room to use this option.";
  195. close;
  196. }
  197. mes "Are you sure you want to give up this room?";
  198. if ( .rentcost )
  199. mes "You will need to pay again to enter this room.";
  200. next;
  201. if ( select( "Yes", "No" ) == 2 ) close;
  202. awake strnpcinfo(0);
  203. end;
  204. }
  205. close;
  206. OnMobDead:
  207. end;
  208. OnEnterMap:
  209. .@id = atoi( strnpcinfo(2) );
  210. .renttime[.@id] = gettimetick(2);
  211. sleep .timeout * 60000;
  212. mapwarp strnpcinfo(4), .respawnmap$, .respawnx, .respawny;
  213. .renttime[.@id] = 0;
  214. killmonsterall strnpcinfo(4);
  215. end;
  216. OnInit:
  217. if ( !getstrlen( strnpcinfo(2) ) ) {
  218. // Config ---------------------------------------------------------------------------------------
  219. // Room rental time, in minutes.
  220. // When time runs out, all players inside the room will be kicked out.
  221. // Do NOT set this to zero!
  222. set .timeout, 60;
  223. set .rentcost, 100000; // Zeny cost for renting a room (0 = free)
  224. set .mvpcost, 100000; // Zeny cost to summon an MVP (0 = free)
  225. set .bosscost, 50000; // Zeny cost to summon a boss monster (0 = free)
  226. // Options setting inside MVP room
  227. set .@menu[1], 1; // Turn Heal option On/Off
  228. set .@menu[2], 1; // Turn MVP Summoning On/Off
  229. set .@menu[3], 1; // Turn Mini boss Summoning On/Off
  230. set .@menu[4], 0; // Sell items (branches) On/Off (see shop below, before the mapflags)
  231. // Respawn point when players leave the room
  232. set .respawnmap$, "prontera";
  233. set .respawnx, 150;
  234. set .respawny, 174;
  235. setarray .mvpid[0],
  236. 1511,// Amon Ra
  237. 1647,// Assassin Cross Eremes
  238. 1785,// Atroce
  239. 1630,// Bacsojin
  240. 1039,// Baphomet
  241. 1874,// Beelzebub
  242. 1272,// Dark Lord
  243. 1719,// Datale
  244. 1046,// Doppelgangger
  245. 1389,// Dracula
  246. 1112,// Drake
  247. 1115,// Eddga
  248. 1418,// Evil Snake Lord
  249. 1871,// Fallen Bishop
  250. 1252,// Garm
  251. 1768,// Gloom Under Night
  252. 1086,// Golden Thief Bug
  253. 1885,// Gopinich
  254. 1649,// High Priest Magaleta
  255. 1651,// High Wizard Katrinn
  256. 1832,// Ifrit
  257. 1492,// Incantation Samurai
  258. 1734,// Kiel D-01
  259. 1251,// Knight of Windstorm
  260. 1779,// Ktullanux
  261. 1688,// Lady Tanee
  262. 1646,// Lord Knight Seyren
  263. 1373,// Lord of Death
  264. 1147,// Maya
  265. 1059,// Mistress
  266. 1150,// Moonlight Flower
  267. 1087,// Orc Hero
  268. 1190,// Orc Lord
  269. 1038,// Osiris
  270. 1157,// Pharaoh
  271. 1159,// Phreeoni
  272. 1623,// RSX 0806
  273. 1650,// Sniper Shecil
  274. 1583,// Tao Gunka
  275. 1708,// Thanatos
  276. 1312,// Turtle General
  277. 1751,// Valkyrie Randgris
  278. 1685,// Vesper
  279. 1648,// Whitesmith Harword
  280. 1917,// Wounded Morocc
  281. 1658;// Ygnizem
  282. setarray .bossid[0],
  283. 1096,// Angeling
  284. 1388,// Archangeling
  285. 1795,// Bloody Knight
  286. 1830,// Bow Guardian
  287. 1839,// Byorgue
  288. 1309,// Cat O' Nine Tail
  289. 1283,// Chimera
  290. 1302,// Dark Illusion
  291. 1198,// Dark Priest
  292. 1582,// Deviling
  293. 1091,// Dragon Fly
  294. 1093,// Eclipse
  295. 1205,// Executioner
  296. 1783,// Galion
  297. 1592,// Gangster
  298. 1120,// Ghostring
  299. 1259,// Gryphon
  300. 1720,// Hydro
  301. 1090,// Mastering
  302. 1289,// Maya Purple
  303. 1262,// Mutant Dragon
  304. 1203,// Mysteltainn
  305. 1870,// Necromancer
  306. 1295,// Owl Baron
  307. 1829,// Sword Guardian
  308. 1204,// Tirfing
  309. 1089,// Toad
  310. 1092,// Vagabond Wolf
  311. 1765;// Valkyrie
  312. // Config Ends ------------------------------------------------------------------------
  313. if ( !.timeout ) set .timeout, 60;
  314. .menu$ = ( .@menu[1] ? "Heal" : "" ) +":" ;
  315. .menu$ = .menu$ + ( .@menu[2] ? "Summon MVP" : "" ) +":";
  316. .menu$ = .menu$ + ( .@menu[3] ? "Summon Mini-boss" : "" ) +":";
  317. .menu$ = .menu$ + ( .@menu[4] ? "Buy branches" : "" ) +":";
  318. .menu$ = .menu$ + "Leave this room:Give up this room";
  319. if ( .@menu[2] ) {
  320. .@size = getarraysize( .mvpid );
  321. for ( .@i = 0; .@i < .@size; .@i++ )
  322. .mvpid_menu$ = .mvpid_menu$ + getmonsterinfo( .mvpid[.@i], MOB_NAME ) +":";
  323. }
  324. if ( .@menu[3] ) {
  325. .@size = getarraysize( .bossid );
  326. for ( .@i = 0; .@i < .@size; .@i++ )
  327. .bossid_menu$ = .bossid_menu$ + getmonsterinfo( .bossid[.@i], MOB_NAME ) +":";
  328. }
  329. }
  330. else {
  331. mapannounce strnpcinfo(4), "An administrator has refreshed the server. Please re-register this room.", bc_map;
  332. mapwarp strnpcinfo(4), .respawnmap$, .respawnx, .respawny;
  333. }
  334. end;
  335. }
  336. - shop MVP room#branch -1,604:100000,12103:1000000
  337. 06guild_01,49,49,4 duplicate(MVP Summoner) MVP Summoner#1 116
  338. 06guild_02,49,49,4 duplicate(MVP Summoner) MVP Summoner#2 116
  339. 06guild_03,49,49,4 duplicate(MVP Summoner) MVP Summoner#3 116
  340. 06guild_04,49,49,4 duplicate(MVP Summoner) MVP Summoner#4 116
  341. 06guild_05,49,49,4 duplicate(MVP Summoner) MVP Summoner#5 116
  342. 06guild_06,49,49,4 duplicate(MVP Summoner) MVP Summoner#6 116
  343. 06guild_07,49,49,4 duplicate(MVP Summoner) MVP Summoner#7 116
  344. 06guild_08,49,49,4 duplicate(MVP Summoner) MVP Summoner#8 116
  345. 06guild_01 mapflag nowarpto
  346. 06guild_02 mapflag nowarpto
  347. 06guild_03 mapflag nowarpto
  348. 06guild_04 mapflag nowarpto
  349. 06guild_05 mapflag nowarpto
  350. 06guild_06 mapflag nowarpto
  351. 06guild_07 mapflag nowarpto
  352. 06guild_08 mapflag nowarpto
  353. 06guild_01 mapflag nomemo
  354. 06guild_02 mapflag nomemo
  355. 06guild_03 mapflag nomemo
  356. 06guild_04 mapflag nomemo
  357. 06guild_05 mapflag nomemo
  358. 06guild_06 mapflag nomemo
  359. 06guild_07 mapflag nomemo
  360. 06guild_08 mapflag nomemo
  361. 06guild_01 mapflag noteleport
  362. 06guild_02 mapflag noteleport
  363. 06guild_03 mapflag noteleport
  364. 06guild_04 mapflag noteleport
  365. 06guild_05 mapflag noteleport
  366. 06guild_06 mapflag noteleport
  367. 06guild_07 mapflag noteleport
  368. 06guild_08 mapflag noteleport
  369. 06guild_01 mapflag nosave SavePoint
  370. 06guild_02 mapflag nosave SavePoint
  371. 06guild_03 mapflag nosave SavePoint
  372. 06guild_04 mapflag nosave SavePoint
  373. 06guild_05 mapflag nosave SavePoint
  374. 06guild_06 mapflag nosave SavePoint
  375. 06guild_07 mapflag nosave SavePoint
  376. 06guild_08 mapflag nosave SavePoint
  377. 06guild_01 mapflag nopenalty
  378. 06guild_02 mapflag nopenalty
  379. 06guild_03 mapflag nopenalty
  380. 06guild_04 mapflag nopenalty
  381. 06guild_05 mapflag nopenalty
  382. 06guild_06 mapflag nopenalty
  383. 06guild_07 mapflag nopenalty
  384. 06guild_08 mapflag nopenalty