summaryrefslogtreecommitdiff
path: root/world/map/npc
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc')
-rw-r--r--world/map/npc/functions/global_event_handler.txt2
-rw-r--r--world/map/npc/items/anchor_stone.txt56
-rw-r--r--world/map/npc/magic/event-summon-managuardian.txt1
-rw-r--r--world/map/npc/magic/event-summon-manatyrant.txt1
-rw-r--r--world/map/npc/magic/level1-summon-maggots.txt1
-rw-r--r--world/map/npc/magic/level2-magic-knuckles.txt38
-rw-r--r--world/map/npc/magic/level2-summon-fluffies.txt1
-rw-r--r--world/map/npc/magic/level2-summon-mouboo.txt1
-rw-r--r--world/map/npc/magic/level2-summon-pinkie.txt1
-rw-r--r--world/map/npc/magic/level2-summon-snakes.txt1
-rw-r--r--world/map/npc/magic/level2-summon-spiky-mushroom.txt1
-rw-r--r--world/map/npc/magic/level2-summon-wickedmushroom.txt1
-rw-r--r--world/map/npc/mobs/miner_mania.txt2
-rw-r--r--world/map/npc/mobs/mob_points.txt4
-rw-r--r--world/map/npc/scripts.conf1
15 files changed, 82 insertions, 30 deletions
diff --git a/world/map/npc/functions/global_event_handler.txt b/world/map/npc/functions/global_event_handler.txt
index d169f3c7..5274fa05 100644
--- a/world/map/npc/functions/global_event_handler.txt
+++ b/world/map/npc/functions/global_event_handler.txt
@@ -45,7 +45,7 @@ OnPCDieEvent:
end;
OnPCLogoutEvent:
-// if (getnpcid("#Upmarmu#" + getcharid(3)) >= 1) addnpctimer 0, "#Upmarmu#" + getcharid(3) + "::OnDestroy"; // @upmarmu_spell_npc_name$ is already lost at this point so it must be done like this
+ if (getnpcid("#Upmarmu#" + getcharid(3)) >= 1) addnpctimer 0, "#Upmarmu#" + getcharid(3) + "::OnDestroy"; // @upmarmu_spell_npc_name$ is already lost at this point so it must be done like this
callfunc "VaultLogout";
end;
diff --git a/world/map/npc/items/anchor_stone.txt b/world/map/npc/items/anchor_stone.txt
new file mode 100644
index 00000000..c1ea722b
--- /dev/null
+++ b/world/map/npc/items/anchor_stone.txt
@@ -0,0 +1,56 @@
+function|script|useAnchorStone
+{
+ addtimer 0, "AS_Core::OnUse";
+ return;
+}
+
+-|script|AS_Core|32767
+{
+ end;
+
+OnUse:
+ if ( @StoneName$ == "AnchorStone" ) goto L_AnchorStone;
+ if ( @StoneName$ == "AnchoredAnchorStone" ) goto L_AnchoredAnchorStone;
+ goto L_Close;
+
+L_AnchorStone:
+ mes "\"You really want to bind the [@@" + AnchorStone + "|@@] to this place?\"";
+ menu
+ "No", L_Close,
+ "Yes", L_AS_Yes;
+
+L_AS_Yes:
+ set AnchorStoneDest, getmaphash(getmap()); // since a hash could be negative I take a separate variable for that since shifting would destroy the sign bit and create a different hash
+ set AnchorStoneDestCoord, gety() << AS_Y_SHIFT | getx() << AS_X_SHIFT;
+
+ delitem AnchorStone, 1;
+ getitem AnchoredAnchorStone, 1;
+ close;
+
+L_AnchoredAnchorStone:
+ if ((AnchorStoneDest < 1) && (AnchorStoneDest > -1)) goto L_AAS_Error;
+ mes "\"You want to recall to the place the [@@" + AnchoredAnchorStone + "|@@] is bound to?\"";
+ menu
+ "No", L_Close,
+ "Yes", L_AAS_Yes;
+
+L_AAS_Yes:
+ warp getmapnamefromhash(AnchorStoneDest), (AnchorStoneDestCoord & AS_X_MASK >> AS_X_SHIFT), (AnchorStoneDestCoord & AS_Y_MASK >> AS_Y_SHIFT);
+
+ goto L_AAStoAS;
+
+L_AAS_Error:
+ mes "\"Something went wrong the [@@" + AnchoredAnchorStone + "|@@] lost its destination and turns back to normal.\"";
+ goto L_AAStoAS;
+
+L_AAStoAS:
+ set AnchorStoneDest, 0;
+ set AnchorStoneDestCoord, 0;
+
+ delitem AnchoredAnchorStone, 1;
+ getitem AnchorStone, 1;
+ close;
+
+L_Close:
+ close;
+}
diff --git a/world/map/npc/magic/event-summon-managuardian.txt b/world/map/npc/magic/event-summon-managuardian.txt
index e66c3eb7..1aa172ad 100644
--- a/world/map/npc/magic/event-summon-managuardian.txt
+++ b/world/map/npc/magic/event-summon-managuardian.txt
@@ -5,7 +5,6 @@
OnCast:
if(call("magic_checks")) end;
// FIXME: Incomplete check, should still work during sieges
- if (getmapflag(getmap(), MF_TOWN)) end;
if (Sp < 100) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
if (countitem("TinyManaElixir") < 1) end;
diff --git a/world/map/npc/magic/event-summon-manatyrant.txt b/world/map/npc/magic/event-summon-manatyrant.txt
index bf2634c5..ff082930 100644
--- a/world/map/npc/magic/event-summon-manatyrant.txt
+++ b/world/map/npc/magic/event-summon-manatyrant.txt
@@ -5,7 +5,6 @@
OnCast:
if(call("magic_checks")) end;
if ($DOOMSDAY_SUMMON < 2) end;
- if (getmapflag(getmap(), MF_TOWN)) end;
if (Sp < 100) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
if (countitem("LargeManaElixir") < 1) end;
diff --git a/world/map/npc/magic/level1-summon-maggots.txt b/world/map/npc/magic/level1-summon-maggots.txt
index 05cadbc8..ce95422c 100644
--- a/world/map/npc/magic/level1-summon-maggots.txt
+++ b/world/map/npc/magic/level1-summon-maggots.txt
@@ -5,7 +5,6 @@
OnCast:
if(call("magic_checks")) end;
if (Sp < 21) end;
- if (getmapflag(getmap(), MF_TOWN)) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
if (countitem("InsectSlime") < 1 || countitem("Root") < 1) end;
if (getmap() == "033-1") goto L_SpecialRules6;
diff --git a/world/map/npc/magic/level2-magic-knuckles.txt b/world/map/npc/magic/level2-magic-knuckles.txt
index a67941cf..92ee07a5 100644
--- a/world/map/npc/magic/level2-magic-knuckles.txt
+++ b/world/map/npc/magic/level2-magic-knuckles.txt
@@ -1,7 +1,7 @@
-|script|magic-knuckles|32767
{
if @_U_BLOCK >= 1 goto L_Still_Exhausted;
-/*
+
set @upmarmu_spell_npc_name$, "#Upmarmu#" + getcharid(3); // make a unique puppet name for every player
set .upmarmu_spell_npc, getnpcid(@upmarmu_spell_npc_name$);
if ( .upmarmu_spell_npc >= 1 ) goto L_NPC_Exists; // if this npc already exist reuse it so that idle recovery timer does not get destroyed
@@ -12,7 +12,6 @@
goto L_NPC_Exists;
L_NPC_Exists:
-*/
if (call("magic_checks")) end;
if (Sp < 20) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
@@ -49,35 +48,29 @@ OnAttack:
if (target(BL_ID, @target_id, 22) != 22) goto L_FreeRecast; // 0x10 | 0x02 | 0x04
void call("elt_damage", @upmarmuspell[0], (@upmarmuspell[3] + @upmarmuspell[4]), ELT_WATER, ELT_FIRE, FX_NONE);
-// addtimer 0, @upmarmu_spell_npc_name$ + "::OnResetTimer";
+ addtimer 0, @upmarmu_spell_npc_name$ + "::OnResetTimer";
set @upmarmuspell[1], @upmarmuspell[1] - 1;
+
+ if @num_upmarmu_hits >= UPMARMU_HITS_TILL_EXHAUST goto L_FreeRecast;
set @num_upmarmu_hits, @num_upmarmu_hits + 1;
+ if @num_upmarmu_hits >= UPMARMU_HITS_TILL_EXHAUST set .exhausted, 1, .upmarmu_spell_npc;
- if @num_upmarmu_hits >= UPMARMU_HITS_TILL_EXHAUST goto L_Exhausted;
goto L_FreeRecast;
L_FreeRecast:
if (@upmarmuspell[1] > 0)
addtimer 0, strnpcinfo(0) + "::OnSetRecast";
+ else
+ addtimer 0, @upmarmu_spell_npc_name$ + "::OnExhausted";
end;
-L_Exhausted:
- set @_U_BLOCK, 1;
- set @upmarmuspell[1], 0;
- misceffect FX_MAGIC_DISCHARGE, strcharinfo(0);
- overrideattack;
- addtimer UPMARMU_EXHAUST_DURATION, "Upmarmu Exhaust Timer::OnClear"; // set the exhaustion time
- sc_start SC_COOLDOWN_UPMARMU, UPMARMU_EXHAUST_DURATION, 0, BL_ID;
- smsg SMSG_FAILURE, "Magic: You are too exhausted to use this spell for a while!";
- goto L_StopTimer;
-
L_Still_Exhausted:
smsg SMSG_FAILURE, "Magic: You are still too exhausted to use this spell for a while!";
end;
L_StopTimer:
-// addtimer 0, @upmarmu_spell_npc_name$ + "::OnStopTimer";
+ addtimer 0, @upmarmu_spell_npc_name$ + "::OnStopTimer";
end;
OnDischarge:
@@ -91,7 +84,6 @@ OnSetRecast:
overrideattack (@upmarmuspell[2] * @upmarmuspell[2]), 1, ATTACK_ICON_GENERIC, OVERRIDE_KNUCKLES, strnpcinfo(0)+"::OnAttack", @upmarmuspell[1]; // delay needs to be squared
end;
-/*
OnResetTimer:
// This timer is if you stopped somewhere below max hits then after 25sec you recover fully and start at 0 hits again
stopnpctimer;
@@ -117,9 +109,20 @@ OnTimer25000:
setnpctimer 0;
end;
+OnExhausted:
+ if (.exhausted < 1) end;
+
+ set @_U_BLOCK, 1;
+ set @upmarmuspell[1], 0;
+ set @num_upmarmu_hits, 0;
+ set .exhausted, 0;
+ addtimer UPMARMU_EXHAUST_DURATION, "Upmarmu Exhaust Timer::OnClear"; // set the exhaustion time
+ sc_start SC_COOLDOWN_UPMARMU, UPMARMU_EXHAUST_DURATION, 0, BL_ID;
+ smsg SMSG_FAILURE, "Magic: You are too exhausted to use this spell for a while!";
+ goto L_StopTimer;
+
OnDestroy:
destroy;
-*/
OnInit:
set .school, SKILL_MAGIC_WAR;
@@ -136,6 +139,5 @@ OnInit:
OnClear:
set @_U_BLOCK, 0;
- set @num_upmarmu_hits, 0;
end;
}
diff --git a/world/map/npc/magic/level2-summon-fluffies.txt b/world/map/npc/magic/level2-summon-fluffies.txt
index f10a86b5..fef40a17 100644
--- a/world/map/npc/magic/level2-summon-fluffies.txt
+++ b/world/map/npc/magic/level2-summon-fluffies.txt
@@ -5,7 +5,6 @@
OnCast:
if(call("magic_checks")) end;
if (Sp < 39) end;
- if (getmapflag(getmap(), MF_TOWN)) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
if (getskilllv(.school) < .level) end;
if (countitem("WhiteFur") < 1 || countitem("Root") < 1) end;
diff --git a/world/map/npc/magic/level2-summon-mouboo.txt b/world/map/npc/magic/level2-summon-mouboo.txt
index c692e9cf..8a8603c6 100644
--- a/world/map/npc/magic/level2-summon-mouboo.txt
+++ b/world/map/npc/magic/level2-summon-mouboo.txt
@@ -5,7 +5,6 @@
OnCast:
if(call("magic_checks")) end;
if (Sp < 35) end;
- if (getmapflag(getmap(), MF_TOWN)) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
if (getskilllv(.school) < .level) end;
if (countitem("MoubooFigurine") < 1 || countitem("Root") < 1) end;
diff --git a/world/map/npc/magic/level2-summon-pinkie.txt b/world/map/npc/magic/level2-summon-pinkie.txt
index 61af9eed..b4774584 100644
--- a/world/map/npc/magic/level2-summon-pinkie.txt
+++ b/world/map/npc/magic/level2-summon-pinkie.txt
@@ -5,7 +5,6 @@
OnCast:
if(call("magic_checks")) end;
if (Sp < 35) end;
- if (getmapflag(getmap(), MF_TOWN)) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
if (getskilllv(.school) < .level) end;
if (countitem("PinkAntenna") < 1 || countitem("Root") < 1) end;
diff --git a/world/map/npc/magic/level2-summon-snakes.txt b/world/map/npc/magic/level2-summon-snakes.txt
index 0723961b..5815cef5 100644
--- a/world/map/npc/magic/level2-summon-snakes.txt
+++ b/world/map/npc/magic/level2-summon-snakes.txt
@@ -5,7 +5,6 @@
OnCast:
if(call("magic_checks")) end;
if (Sp < 40) end;
- if (getmapflag(getmap(), MF_TOWN)) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
if (getskilllv(.school) < .level) end;
if (countitem("DarkCrystal") < 1 || countitem("SnakeEgg") < 1) end;
diff --git a/world/map/npc/magic/level2-summon-spiky-mushroom.txt b/world/map/npc/magic/level2-summon-spiky-mushroom.txt
index 701648d5..0f884185 100644
--- a/world/map/npc/magic/level2-summon-spiky-mushroom.txt
+++ b/world/map/npc/magic/level2-summon-spiky-mushroom.txt
@@ -5,7 +5,6 @@
OnCast:
if(call("magic_checks")) end;
if (Sp < 33) end;
- if (getmapflag(getmap(), MF_TOWN)) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
if (getskilllv(.school) < .level) end;
if (countitem("HardSpike") < 1 || countitem("Root") < 1) end;
diff --git a/world/map/npc/magic/level2-summon-wickedmushroom.txt b/world/map/npc/magic/level2-summon-wickedmushroom.txt
index 014a5d80..7d0e93c1 100644
--- a/world/map/npc/magic/level2-summon-wickedmushroom.txt
+++ b/world/map/npc/magic/level2-summon-wickedmushroom.txt
@@ -5,7 +5,6 @@
OnCast:
if(call("magic_checks")) end;
if (Sp < 42) end;
- if (getmapflag(getmap(), MF_TOWN)) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
if (getskilllv(.school) < .level) end;
if (countitem("DarkCrystal") < 1 || countitem("SmallMushroom") < 1) end;
diff --git a/world/map/npc/mobs/miner_mania.txt b/world/map/npc/mobs/miner_mania.txt
index 445c82e0..a496697d 100644
--- a/world/map/npc/mobs/miner_mania.txt
+++ b/world/map/npc/mobs/miner_mania.txt
@@ -53,7 +53,7 @@ Note:
setarray $@slime_mine_maps_y0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23, -1;
setarray $@slime_mine_maps_x1, -1, -1, 100, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 173, -1;
setarray $@slime_mine_maps_y1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 170, -1;
- setarray $@slimes, CopperSlime, SilverSlime, BromenalSlime, GoldSlime, IronSlime, CoalSlime;
+ setarray $@slimes, CopperSlime, SilverSlime, BromenalSlime, GoldSlime, IronSlime, CoalSlime, StoneSlime;
// Bifs -----------------------------
diff --git a/world/map/npc/mobs/mob_points.txt b/world/map/npc/mobs/mob_points.txt
index d0ede2f1..2589f1eb 100644
--- a/world/map/npc/mobs/mob_points.txt
+++ b/world/map/npc/mobs/mob_points.txt
@@ -232,7 +232,9 @@ function|script|MobPoints
1, // 1221 SmallRubyBif
1, // 1222 SmallSapphireBif
1, // 1223 SmallTopazBif
- 200 // 1224 CoalGolem
+ 200, // 1224 CoalGolem
+ 25, // 1225 StoneSlime
+ 200 // 1226 StoneGolem
; // END
// the following mobs where replaced by other mobs:
diff --git a/world/map/npc/scripts.conf b/world/map/npc/scripts.conf
index 17045566..b0a5f0c2 100644
--- a/world/map/npc/scripts.conf
+++ b/world/map/npc/scripts.conf
@@ -64,6 +64,7 @@ npc: npc/items/underworld_troll.txt
npc: npc/items/silver_bell.txt
npc: npc/items/shovel.txt
npc: npc/items/maps.txt
+npc: npc/items/anchor_stone.txt
// Mob Functions
npc: npc/mobs/miner_mania.txt