Advertisement
Guest User

Untitled

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