nguild_managers.txt 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. //===== rAthena Script =======================================
  2. //= War of Emperium Managers for N Guild Castles
  3. //===== By: ==================================================
  4. //= kobra_k88
  5. //===== Current Version: =====================================
  6. //= 1.2
  7. //===== Compatible With: =====================================
  8. //= rAthena Project; RO Episode 4+
  9. //===== Description: =========================================
  10. //=
  11. //==============================================
  12. //= Break down of arguments used in the function:
  13. //= arg(0): name of Castle Manager
  14. //= arg(1): name of guild castle.
  15. //= arg(2): x1 coordinate for warp to treasure room
  16. //= arg(3): y1 coordinate for warp to treasure room
  17. //= arg(4): guild script suffix for kafra, etc.
  18. //===== Additional Comments: =================================
  19. //= 1.0 Based off existing guild scripts. Do not know if it is accurate.[kobra_k88]
  20. //= 1.1 Added modified guild manager function. [L0ne_W0lf]
  21. //= Removed guardian summoning.
  22. //= 1.2 Corrected function name. (bugreport:1728) [L0ne_W0lf]
  23. //============================================================
  24. //==============================================
  25. function script F_GldManager {
  26. .@npc_name$ = getarg(0);
  27. .@map_name$ = getarg(1);
  28. .@gid = getcastledata(.@map_name$,1);
  29. .@gm_name$ = getguildmaster(.@gid);
  30. mes "[ "+ .@npc_name$ +" ]";
  31. if (.@gid == 0){
  32. mes "I am waiting for my master. Brave adventurer, follow your destiny!";
  33. return;
  34. }
  35. if (getcharid(2) != .@gid){
  36. mes "I am here to follow ^5533FF" + getguildmaster(.@gid) + "^000000's command! Hey! Your not even a part of the guild!!";
  37. mes "Where are the guardians? Destroy these intruders!";
  38. return;
  39. }
  40. if (is_guild_leader() == false){
  41. mes "You're not ^5533FF" + getguildmaster(.@gid) + "^000000! I am here to follow ^5533FF" + getguildmaster(.@gid) + "^000000's command only";
  42. return 0;
  43. }
  44. mes "Welcome Master ^5533FF" + getguildmaster(.@gid) + "^000000 ! I will assist you in any way I can!";
  45. next;
  46. menu "Kafra Staff Employment / Dismissal",M_Kaf, "Enter Treasure Room",M_Treas, "Cancel",M_End;
  47. //===========================
  48. M_Kaf:
  49. //======
  50. mes "[ "+ .@npc_name$ +" ]";
  51. if (GetCastleData(.@map_name$,9) == 1) goto L_Dismiss;
  52. if (getgdskilllv(.@gid,10001) == 0){
  53. mes "Master, you don't have a contract with the Kafra Staff Company.";
  54. mes "In order to hire a Kafra, you must first learn the Guild skill ^5533FFContract With Kafra^000000.";
  55. return;
  56. }
  57. L_Hire:
  58. mes "Would you like to employ the services of a Kafra? You will need ^5533FF10,000 Zeny^000000 to do so... ";
  59. next;
  60. menu "Employ Kafra.",-,"Cancel",sM_KafEnd;
  61. mes "[ "+ .@npc_name$ +" ]";
  62. if (Zeny < 10000){
  63. mes "Master, you do not have enough money to employ a Kafra. Employment has been cancelled.";
  64. return;
  65. }
  66. set Zeny,Zeny-10000;
  67. enablenpc "Kafra Staff#"+getarg(4);
  68. SetCastleData .@map_name$,9,1;
  69. mes "You have created a contract with the Kafra Staff Company.";
  70. next;
  71. cutin "kafra_01",2;
  72. mes "[ Kafra Staff ]";
  73. mes "How do you do? I'm here to provide you with helpful service! I'll do the best I can to serve you.";
  74. next;
  75. cutin "kafra_01",255;
  76. mes "[ "+ .@npc_name$ +" ]";
  77. //mes "Your employment contract lasts ^5533FF1 month^000000. After this term is over you will have to create a new contract.";
  78. mes "I think the Kafra Staff will benefit our guild members.";
  79. return;
  80. sM_KafEnd:
  81. mes "[ "+ .@npc_name$ +" ]";
  82. mes "As you wish Master. But I suggest we get a Kafra as soon as possible!";
  83. return;
  84. L_Dismiss:
  85. mes "Would you like to dismiss the current Kafra?";
  86. next;
  87. menu "Dismissal",-,"Cancel",sM_KafEnd2;
  88. cutin "kafra_01",2;
  89. mes "[ Kafra Staff ]";
  90. mes "Have I done anything wrong? If I did, will you please forgive me?";
  91. next;
  92. menu "Dismiss",-,"Cancel",ssM_KafEnd2;
  93. mes "[ Kafra Staff ]";
  94. mes "It's unfortunate that I won't be able to serve your guild anymore....";
  95. next;
  96. disablenpc "Kafra Staff#"+getarg(4);
  97. SetCastleData .@map_name$,9,0;
  98. cutin "kafra_01",255;
  99. mes "[ "+ .@npc_name$ +" ]";
  100. mes "The Kafra has been dismissed. But... we should really get a Kafra as soon as possible!";
  101. return;
  102. ssM_KafEnd2:
  103. mes "[ Kafra Staff ]";
  104. mes "Thank you master, I'll do my best! ^^.";
  105. cutin "kafra_01",255;
  106. return;
  107. sM_KafEnd2:
  108. mes "[ "+ .@npc_name$ +" ]";
  109. mes "Master, I think you should keep the current Kafra Staff because she is already trying her best to serve us";
  110. return;
  111. //=========================
  112. M_Treas:
  113. //========
  114. mes "[ "+ .@npc_name$ +" ]";
  115. mes "Would you to go to our Treasure Room? Only you, the Guild Master, are allowed to enter this room.";
  116. next;
  117. menu "Enter Treasure room.",-,"Cancel",sM_TresEnd;
  118. mes "[ "+ .@npc_name$ +" ]";
  119. mes "Please follow me through the secret passage way.";
  120. mes "You must pull down on the secret switch in order to get out.";
  121. next;
  122. warp .@map_name$,getarg(2),getarg(3);
  123. return;
  124. sM_TresEnd:
  125. mes "[ "+ .@npc_name$ +" ]";
  126. mes "The goods are produced everyday.";
  127. mes "You should get them whenever you can because they might dissapear if you take them at the wrong time.";
  128. return;
  129. //==========================
  130. M_End:
  131. //=======
  132. mes "[ "+ .@npc_name$ +" ]";
  133. mes "As you wish, master.";
  134. return;
  135. }
  136. // Castle 1 ==================================================================================
  137. nguild_alde,218,175,0 script Frolo 55,{
  138. callfunc "F_GldManager","Frolo","nguild_alde",119,223,"N01";
  139. close;
  140. }
  141. // Castle 2 ==================================================================================
  142. nguild_gef,40,48,5 script Leiber 55,{
  143. callfunc "F_GldManager","Leiber","nguild_gef",155,112,"N02";
  144. close;
  145. }
  146. // Castle 3 ==================================================================================
  147. nguild_pay,120,58,4 script Dundar 55,{
  148. callfunc "F_GldManager","Dundar","nguild_pay",290,7,"N03";
  149. close;
  150. }
  151. // Castle 4 ==================================================================================
  152. nguild_prt,112,181,0 script Thefton 55,{
  153. callfunc "F_GldManager","Thefton","nguild_prt",15,209,"N04";
  154. close;
  155. }