Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 8.74 KB | None | 0 0
  1. From 1b0ddb82d4ec8b3a24f32af1d34bf8d8b5ea8f51 Mon Sep 17 00:00:00 2001
  2. From: Coffee <coffee@coffee-EP45-UD3L.(none)>
  3. Date: Sat, 2 Jul 2011 11:02:55 -0300
  4. Subject: [PATCH] First try at a new fight for the evil obelisk. Only a test version.
  5.  
  6. ---
  7.  world/map/npc/018-1/_import.txt      |    1 +
  8.  world/map/npc/018-1/_warps.txt       |    2 +-
  9.  world/map/npc/018-1/in.txt           |   34 ++++++++++++
  10.  world/map/npc/018-3/_import.txt      |    1 +
  11.  world/map/npc/018-3/_warps.txt       |    2 +-
  12.  world/map/npc/018-3/evil-obelisk.txt |  100 +++++++++++++++++++++++++++++++---
  13.  world/map/npc/018-3/out.txt          |   29 ++++++++++
  14.  7 files changed, 160 insertions(+), 9 deletions(-)
  15.  create mode 100644 world/map/npc/018-1/in.txt
  16.  create mode 100644 world/map/npc/018-3/out.txt
  17.  
  18. diff --git a/world/map/npc/018-1/_import.txt b/world/map/npc/018-1/_import.txt
  19. index b3ab984..f4f3abb 100644
  20. --- a/world/map/npc/018-1/_import.txt
  21. +++ b/world/map/npc/018-1/_import.txt
  22. @@ -6,3 +6,4 @@ npc: npc/018-1/_warps.txt
  23.  npc: npc/018-1/mike.txt
  24.  npc: npc/018-1/miners.txt
  25.  npc: npc/018-1/sword.txt
  26. +npc: npc/018-1/in.txt
  27. diff --git a/world/map/npc/018-1/_warps.txt b/world/map/npc/018-1/_warps.txt
  28. index 028dbd0..cdb473e 100644
  29. --- a/world/map/npc/018-1/_warps.txt
  30. +++ b/world/map/npc/018-1/_warps.txt
  31. @@ -1,8 +1,8 @@
  32.  // This file is generated automatically. All manually changes will be removed when running the Converter.
  33.  // Woodland mining camp warps
  34. +// I removed one of the warps manually only for testing purposes.
  35.  
  36.  018-1.gat,79,59    warp    toMine  0,-1,018-3.gat,99,132
  37. -018-1.gat,112,61   warp    toCave  -1,-1,018-3.gat,44,36
  38.  018-1.gat,115,40   warp    toCave  -1,-1,013-3.gat,22,114
  39.  018-1.gat,128,56   warp    toCave  -1,-1,018-3.gat,49,97
  40.  018-1.gat,90,42    warp    toCave  -1,-1,018-3.gat,123,164
  41. diff --git a/world/map/npc/018-1/in.txt b/world/map/npc/018-1/in.txt
  42. new file mode 100644
  43. index 0000000..39745b5
  44. --- /dev/null
  45. +++ b/world/map/npc/018-1/in.txt
  46. @@ -0,0 +1,34 @@
  47. +// Authors: alastrim
  48. +
  49. +018-1.gat,112,60,0 script  #in 45,1,1{
  50. +// Maybe we should charge something for going inside to avoid people bringing tanked mules inside to get more money.
  51. +    menu
  52. +        "Get in.", -,
  53. +        "Stay outside.", L_Close;
  54. +
  55. +    if ($@obelisk_status == 1) end;
  56. +    set @loop, 0;
  57. +
  58. +L_Findregister:
  59. +    set @loop, @loop + 1;
  60. +    if ($@obelisk_fighters$[@loop] == "") goto L_Addplayer;
  61. +    if (@loop > $@MAX_PLAYERS_OBELISK) goto L_Full;
  62. +    goto L_Findregister;
  63. +    close;
  64. +
  65. +L_Addplayer:
  66. +    set $@obelisk_fighters$[@loop], strcharinfo(0);
  67. +    set $@obelisk_level, $@obelisk_level + Baselevel;
  68. +    set $@obelisk_alive, $@obelisk_alive + 1;
  69. +    warp "018-3.gat", 44, 35;
  70. +    mes "Debug message: Array size is " + getarraysize($@obelisk_fighters$) + " and " + $@obelisk_fighters$[1] + "=1" + $@obelisk_fighters$[2] + "=2" + $@obelisk_fighters$[3] + "=3" + $@obelisk_fighters$[4] + "=4" + $@obelisk_fighters$[5] + "=5" + $@obelisk_fighters$[6] + "=6" + $@obelisk_fighters$[7] + "=7" + $@obelisk_fighters$[8] + "=8" + $@obelisk_fighters$[9] + "=9" + $@obelisk_fighters$[10] + "=10";
  71. +    close;
  72. +
  73. +L_Full:
  74. +    message strcharinfo(0), "It is full of people!";
  75. +    close;
  76. +
  77. +L_Close:
  78. +    close;
  79. +
  80. +}
  81. diff --git a/world/map/npc/018-3/_import.txt b/world/map/npc/018-3/_import.txt
  82. index 53391a0..77ece0f 100644
  83. --- a/world/map/npc/018-3/_import.txt
  84. +++ b/world/map/npc/018-3/_import.txt
  85. @@ -6,3 +6,4 @@ npc: npc/018-3/_warps.txt
  86.  npc: npc/018-3/bookcase.txt
  87.  npc: npc/018-3/evil-obelisk.txt
  88.  npc: npc/018-3/sword.txt
  89. +npc: npc/018-3/out.txt
  90. diff --git a/world/map/npc/018-3/_warps.txt b/world/map/npc/018-3/_warps.txt
  91. index a4450b3..a813252 100644
  92. --- a/world/map/npc/018-3/_warps.txt
  93. +++ b/world/map/npc/018-3/_warps.txt
  94. @@ -1,8 +1,8 @@
  95.  // This file is generated automatically. All manually changes will be removed when running the Converter.
  96.  // Cave warps
  97. +// I removed one of the warps manually only for testing purposes.
  98.  
  99.  018-3.gat,100,133  warp    toOutside   0,-1,018-1.gat,78,60
  100. -018-3.gat,44,37    warp    toOutside   -1,-1,018-1.gat,112,62
  101.  018-3.gat,49,98    warp    toOutside   -1,-1,018-1.gat,128,57
  102.  018-3.gat,123,165  warp    toOutside   -1,-1,018-1.gat,90,43
  103.  018-3.gat,70,104   warp    toOutside   -1,-1,018-1.gat,69,55
  104. diff --git a/world/map/npc/018-3/evil-obelisk.txt b/world/map/npc/018-3/evil-obelisk.txt
  105. index 4893cfe..361f06b 100644
  106. --- a/world/map/npc/018-3/evil-obelisk.txt
  107. +++ b/world/map/npc/018-3/evil-obelisk.txt
  108. @@ -1,10 +1,96 @@
  109. -//
  110. +// Authors: alastrim
  111.  
  112.  018-3.gat,67,28,0  script  Evil Obelisk    185, {
  113. -   callfunc "ClearVariables";
  114. -   set @map$, "018-3.gat";
  115. -   set @x, 67;
  116. -   set @y, 28;
  117. -   callfunc "EvilObelisk";
  118. -   close;
  119. +// To do: Add a nosave flag, so you cannot relog inside the cave. But it would probably require transfering the obelisk cave to another map, since 018-3 map has other uses.
  120. +    mes "[Evil Obelisk]";
  121. +    mes "(A mystical aura surrounds this stone.  It seems to crave money.)";
  122. +    next;
  123. +
  124. +    menu
  125. +        "Pay it x gold", L_Start,
  126. +        "Don't pay it anything.", -;
  127. +    close;
  128. +
  129. +L_Start:
  130. +// Change to the minimum amount of players later
  131. +    if ($@obelisk_alive <= 1) goto L_Fewplayers;
  132. +    set $@x1, 20;
  133. +    set $@y1, 20;
  134. +    set $@x2, 77;
  135. +    set $@y2, 37;
  136. +    set $@obelisk_status, 1;
  137. +    set $@obelisk_round, 1;
  138. +    close2;
  139. +    goto L_Summon;
  140. +
  141. +L_Summon:
  142. +// This is just a test. We have to think about a way to make it increasingly difficult to avoid people using it to get rich.
  143. +    areamonster "018-3.gat",$@x1,$@y1,$@x2,$@y2,"Evil",1008,5*$@obelisk_alive,"Evil Obelisk::OnMobDeath";
  144. +    startnpctimer;
  145. +    setnpctimer 0;
  146. +    end;
  147. +
  148. +OnMobDeath:
  149. +    end;
  150. +
  151. +OnTimer10000:
  152. +    set $@obelisk_round, $@obelisk_round + 1;
  153. +    set $@obelisk_loop, 0;
  154. +    set $@obelisk_alive, 0;
  155. +
  156. +L_Findregister:
  157. +    set $@obelisk_loop, $@obelisk_loop + 1;
  158. +    if ($@obelisk_fighters$[$@obelisk_loop] != "") goto L_Rewardplayer;
  159. +    if ($@obelisk_loop > $@MAX_PLAYERS_OBELISK) goto L_Checkfightstate;
  160. +    goto L_Findregister;
  161. +    end;
  162. +
  163. +L_Rewardplayer:
  164. +    if (isloggedin(getcharid(3,$@obelisk_fighters$[$@obelisk_loop]))==0) goto L_Findregister;
  165. +    set $@obelisk_alive, $@obelisk_alive + 1;
  166. +    attachrid(getcharid(3,$@obelisk_fighters$[$@obelisk_loop]));
  167. +    message strcharinfo(0), "Debug message: In every round each player gain some money...";
  168. +    set Zeny, Zeny + 50;
  169. +    detachrid;
  170. +    goto L_Findregister;
  171. +
  172. +L_Checkfightstate:
  173. +    if ($@obelisk_alive < 1) goto L_Clean;
  174. +
  175. +L_Chooseone:
  176. +    set $@Thechosen, rand(1, $@obelisk_alive);
  177. +    if (isloggedin(getcharid(3,$@obelisk_fighters$[$@Thechosen]))==0) goto L_Chooseone;
  178. +    attachrid(getcharid(3,$@obelisk_fighters$[$@Thechosen]));
  179. +    message strcharinfo(0), "Debug message: In every round the script select a random player and summons the monster right next to him. This time you are the chosen one... :D ";
  180. +    set $@x1, getx(0)-2;
  181. +    set $@y1, gety(0)-2;
  182. +    set $@x2, $@x1 + 4;
  183. +    set $@y2, $@y1 + 4;
  184. +    goto L_Summon;
  185. +    end;
  186. +
  187. +L_Fewplayers:
  188. +    mes "Nothing happens.";
  189. +    close;
  190. +
  191. +L_Clean:
  192. +    killmonster "018-3.gat","Evil Obelisk::OnMobDeath";
  193. +    set $@obelisk_status, 0;
  194. +    set $@obelisk_round, 0;
  195. +    set $@obelisk_alive, 0;
  196. +    set $@obelisk_loop, 0;
  197. +    set $@obelisk_level, 0;
  198. +    set $@x1, 0;
  199. +    set $@y1, 0;
  200. +    set $@x2, 0;
  201. +    set $@y2, 0;
  202. +    cleararray $@obelisk_fighters$,0,$@MAX_PLAYERS_OBELISK;
  203. +    stopnpctimer;
  204. +    setnpctimer 0;
  205. +    end;
  206. +
  207. +OnInit:
  208. +    set $@MAX_PLAYERS_OBELISK, 10;
  209. +    initnpctimer;
  210. +    stopnpctimer;
  211.  }
  212. diff --git a/world/map/npc/018-3/out.txt b/world/map/npc/018-3/out.txt
  213. new file mode 100644
  214. index 0000000..906dc5c
  215. --- /dev/null
  216. +++ b/world/map/npc/018-3/out.txt
  217. @@ -0,0 +1,29 @@
  218. +// Author: alastrim
  219. +
  220. +018-3.gat,44,38,0  script  #out    45,1,1{
  221. +
  222. +    menu
  223. +        "Get out.", -,
  224. +        "Stay inside.", L_Close;
  225. +
  226. +    if ($@obelisk_status == 1) end;
  227. +    set @loop, 0;
  228. +
  229. +L_Findregister:
  230. +    set @loop, @loop + 1;
  231. +    if ($@obelisk_fighters$[@loop] == strcharinfo(0)) goto L_Removeplayer;
  232. +    if (@loop > $@MAX_PLAYERS_OBELISK) goto L_Close;
  233. +    goto L_Findregister;
  234. +
  235. +L_Removeplayer:
  236. +    set $@obelisk_level, $@obelisk_level - Baselevel;
  237. +    set $@obelisk_fighters$[@loop], "";
  238. +    set $@obelisk_alive, $@obelisk_alive - 1;
  239. +    warp "018-1.gat", 112, 63;
  240. +    mes "Debug message: Array size is " + getarraysize($@obelisk_fighters$) + " and " + $@obelisk_fighters$[1] + "=1" + $@obelisk_fighters$[2] + "=2" + $@obelisk_fighters$[3] + "=3" + $@obelisk_fighters$[4] + "=4" + $@obelisk_fighters$[5] + "=5" + $@obelisk_fighters$[6] + "=6" + $@obelisk_fighters$[7] + "=7" + $@obelisk_fighters$[8] + "=8" + $@obelisk_fighters$[9] + "=9" + $@obelisk_fighters$[10] + "=10";
  241. +    close;
  242. +
  243. +L_Close:
  244. +    close;
  245. +
  246. +}
  247. --
  248. 1.7.4.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement