From 5a907c26b3d25fda31ca85c899068e0e99697ca8 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 1 May 2016 20:33:01 -0400 Subject: remove attachrid from necromancy spell --- world/map/npc/magic/level3-necromancy.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'world/map') diff --git a/world/map/npc/magic/level3-necromancy.txt b/world/map/npc/magic/level3-necromancy.txt index 57f5a6cc..2cd6724d 100644 --- a/world/map/npc/magic/level3-necromancy.txt +++ b/world/map/npc/magic/level3-necromancy.txt @@ -24,8 +24,7 @@ set @necromancer, CHAR_ID, @target_id; // tell the target who is reviving them - if (attachrid(@target_id) != 1) end; - addtimer 6000, strnpcinfo(0)+"::OnRevive"; // TODO: make it take more or less time depending on the spell power + addtimer 6000, strnpcinfo(0)+"::OnRevive", @target_id; // TODO: make it take more or less time depending on the spell power end; OnRevive: -- cgit v1.2.3-70-g09d2 From 197d9c360111ba47c4ffba3bdba274ea440314c1 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 1 May 2016 20:52:51 -0400 Subject: remove attachrid from kaflosh spell --- world/map/npc/magic/level2-rain.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'world/map') diff --git a/world/map/npc/magic/level2-rain.txt b/world/map/npc/magic/level2-rain.txt index d3718170..32a2c0f8 100644 --- a/world/map/npc/magic/level2-rain.txt +++ b/world/map/npc/magic/level2-rain.txt @@ -63,8 +63,8 @@ L_Tree: close; OnLaunch: - if(attachrid(.caster) != 1) destroy; // destroy if caster is missing - if(getmap() != strnpcinfo(3)) destroy; // destroy if caster left the map + if(get(BL_ID, .caster) != .caster) destroy; // destroy if caster is missing + if(getmap(.caster) != strnpcinfo(3)) destroy; // destroy if caster left the map set .count, .count + 1; if(.count > .max) destroy; set .launch, 0; @@ -75,14 +75,14 @@ OnLaunch: S_Launch: npcareawarp .initial_x - .radius, .initial_y - .radius, .initial_x + .radius, .initial_y + .radius, 0, strnpcinfo(0); misceffect FX_RAIN; - foreach 2, strnpcinfo(3), getnpcx()-1, getnpcy()-1, getnpcx()+1, getnpcy()+1, strnpcinfo(0) + "::OnHit"; + foreach 2, strnpcinfo(3), getnpcx()-1, getnpcy()-1, getnpcx()+1, getnpcy()+1, strnpcinfo(0) + "::OnHit", .caster; set .launch, .launch + 1; if(.launch < .max_launch) goto S_Launch; return; OnHit: - if(attachrid(.caster) != 1) destroy; // destroy if caster is missing - if(getmap() != strnpcinfo(3)) destroy; // destroy if caster left the map + if(get(BL_ID, .caster) != .caster) destroy; // destroy if caster is missing + if(getmap(.caster) != strnpcinfo(3)) destroy; // destroy if caster left the map if(target(.caster, @target_id, 16) != 16 && .caster != @target_id) end; if((get(BL_TYPE, @target_id) & 1) == 0) end; // either mob or pc if(get(ELTTYPE, @target_id) == ELT_FIRE) @@ -90,7 +90,7 @@ OnHit: end; OnDestroy: - debugmes "kaflosh timeout! [this shouldn't happen]"; + debugmes "kaflosh timeout! [this shouldn't happen]"; // XXX: looks like this CAN happen with higher levels of magic, so we might want to cap max charges destroy; OnInit: -- cgit v1.2.3-70-g09d2 From a19798682151b71f96a9cb15f1ac09dbf0253880 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 1 May 2016 20:59:10 -0400 Subject: remove attachrid from betsanc spell --- world/map/npc/magic/level2-protect.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'world/map') diff --git a/world/map/npc/magic/level2-protect.txt b/world/map/npc/magic/level2-protect.txt index db11105f..659efdc1 100644 --- a/world/map/npc/magic/level2-protect.txt +++ b/world/map/npc/magic/level2-protect.txt @@ -11,11 +11,7 @@ if (@target_id < 1 || !(isloggedin(@target_id)) || get(INVISIBLE, @target_id)) set @target_id, BL_ID; // fallback to self - set @betsanc_caster, BL_ID, @target_id; - if (attachrid(@target_id) != 1) end; - set @target_hat, getequipid(equip_head), @betsanc_caster; - if (attachrid(@betsanc_caster) != 1) end; - if (@target_hat == 888) end; // FIXME: this whole 5 line block could be done with only one line if we modify getequipid + if (getequipid(equip_head, strcharinfo(0, @target_id)) == 888) end; if (distance(BL_ID, @target_id) >= (@spellpower/30)+2) set @target_id, BL_ID; if (get(@antiprotect, @target_id) > 0) end; @@ -33,8 +29,7 @@ set @betsanc_time, .@time, @target_id; sc_start SC_PHYS_SHIELD, .@time, max(15,(@spellpower/20))+5, @target_id; message @args$, "Shield : You feel more protected."; - if (attachrid(@target_id) != 1) end; - addtimer @betsanc_time, strnpcinfo(0)+"::OnEnd"; + addtimer @betsanc_time, strnpcinfo(0)+"::OnEnd", @target_id; end; OnEnd: -- cgit v1.2.3-70-g09d2 From e4fd108de7320ba7a55810f5483113aad81ee43a Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 1 May 2016 21:19:00 -0400 Subject: remove attachrid from inma spell --- world/map/npc/magic/level2-lay-on-hands.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'world/map') diff --git a/world/map/npc/magic/level2-lay-on-hands.txt b/world/map/npc/magic/level2-lay-on-hands.txt index 22287497..0affb210 100644 --- a/world/map/npc/magic/level2-lay-on-hands.txt +++ b/world/map/npc/magic/level2-lay-on-hands.txt @@ -28,7 +28,6 @@ L_Pay: set .@heal_value, if_then_else(.@payment < .@available, .@needed+1-1, (.@available * 200) / .@fraction); // FIXME / XXX why the f do I need to do +1-1 ? if (.@payment > .@available) set .@payment, .@available; - set @inma_power, .@heal_value, @target_id; set @mexp, min(.exp_gain, .@payment/100); callfunc "gain_heal_xp"; @@ -39,8 +38,9 @@ L_Pay: if (.@dark) heal .@bad, 0; sc_start SC_HALT_REGENERATE, if_then_else(.@dark, 5000, 10000), 0; - if (attachrid(@target_id) != 1) end; - if (!(isdead())) heal @inma_power, 0; + set .@thp, get(Hp, @target_id); + if (.@thp < 1) end; + set Hp, .@thp + .@heal_value, @target_id; end; L_Mouboo: -- cgit v1.2.3-70-g09d2 From b73ce2f464f15ee01368890e7dfaba2fecee5dbb Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 1 May 2016 21:19:54 -0400 Subject: remove attachrid from anwiltyp spell --- world/map/npc/magic/level2-hide.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'world/map') diff --git a/world/map/npc/magic/level2-hide.txt b/world/map/npc/magic/level2-hide.txt index ff67e6a5..6d9c125d 100644 --- a/world/map/npc/magic/level2-hide.txt +++ b/world/map/npc/magic/level2-hide.txt @@ -26,8 +26,7 @@ sc_start SC_HIDE, .@time, 0, @target_id; message @args$, "Magic : You are hidden!"; if (BL_ID != @target_id) message strcharinfo(0), "Magic : You hid someone!"; - if (attachrid(@target_id) != 1) end; - addtimer @anwiltyp_time, strnpcinfo(0)+"::OnEnd"; + addtimer @anwiltyp_time, strnpcinfo(0)+"::OnEnd", @target_id; end; OnEnd: -- cgit v1.2.3-70-g09d2 From c16033aed34246336502a1bbaec1a06d77cd35b1 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 1 May 2016 21:22:54 -0400 Subject: remove attachrid from joyplim spell --- world/map/npc/magic/level2-happy-curse.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'world/map') diff --git a/world/map/npc/magic/level2-happy-curse.txt b/world/map/npc/magic/level2-happy-curse.txt index dbfea17a..a82dce21 100644 --- a/world/map/npc/magic/level2-happy-curse.txt +++ b/world/map/npc/magic/level2-happy-curse.txt @@ -23,9 +23,8 @@ set @joyplim_count, 1, @target_id; set @joyplim_emote, if_then_else(getskilllv(SKILL_MAGIC_DARK) > 1, EMOTE_EVIL, EMOTE_HAPPY), @target_id; set @joyplim_total, (@spellpower/10), @target_id; - if (attachrid(@target_id) != 1) end; - emotion @joyplim_emote, "self"; - addtimer 500, strnpcinfo(0)+"::OnEmote"; + emotion @joyplim_emote, strcharinfo(0, @target_id); + addtimer 500, strnpcinfo(0)+"::OnEmote", @target_id; end; OnEmote: -- cgit v1.2.3-70-g09d2 From c6bad5e24eacb3ef84a973685ce4fff028c4bc99 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 1 May 2016 21:25:30 -0400 Subject: remove attachrid from plugh spell --- world/map/npc/magic/level2-flying-backpack.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'world/map') diff --git a/world/map/npc/magic/level2-flying-backpack.txt b/world/map/npc/magic/level2-flying-backpack.txt index 5e19468e..87c7d644 100644 --- a/world/map/npc/magic/level2-flying-backpack.txt +++ b/world/map/npc/magic/level2-flying-backpack.txt @@ -22,8 +22,7 @@ set @plugh_time, (@spellpower*500)+5000, @target_id; sc_start SC_FLYING_BACKPACK, @plugh_time, 0, @target_id; message @args$, "Backpack : Your backpack is lifted by a mystical force; you no longer feel it pressing on your back."; - if (attachrid(@target_id) != 1) end; - addtimer @plugh_time, strnpcinfo(0)+"::OnEnd"; + addtimer @plugh_time, strnpcinfo(0)+"::OnEnd", @target_id; end; OnEnd: -- cgit v1.2.3-70-g09d2 From bcdcf68588639e81b3243342c6fc39946e97de7e Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 1 May 2016 21:26:45 -0400 Subject: remove attachrid from betsanc spell --- world/map/npc/magic/level2-barrier.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'world/map') diff --git a/world/map/npc/magic/level2-barrier.txt b/world/map/npc/magic/level2-barrier.txt index 9afd4f38..9526ee5a 100644 --- a/world/map/npc/magic/level2-barrier.txt +++ b/world/map/npc/magic/level2-barrier.txt @@ -11,11 +11,7 @@ if (@target_id < 1 || !(isloggedin(@target_id)) || get(INVISIBLE, @target_id) == 1) set @target_id, BL_ID; // fallback to self - set @asorm_caster, BL_ID, @target_id; - if (attachrid(@target_id) != 1) end; - set @target_hat, getequipid(equip_head), @asorm_caster; - if (attachrid(@asorm_caster) != 1) end; - if (@target_hat == 888) end; // FIXME: this whole 5 line block could be done with only one line if we modify getequipid OR make equip_ into params + if (getequipid(equip_head, strcharinfo(0, @target_id)) == 888) end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 1000, "Magic Timer::OnClear"; // set the new debuff @@ -31,8 +27,7 @@ set @asorm_time, .@time, @target_id; sc_start SC_MBARRIER, .@time, max(30,(@spellpower/8))+20, @target_id; message @args$, "Barrier : You are surrounded by a magical barrier."; - if (attachrid(@target_id) != 1) end; - addtimer @asorm_time, strnpcinfo(0)+"::OnEnd"; + addtimer @asorm_time, strnpcinfo(0)+"::OnEnd", @target_id; end; OnEnd: -- cgit v1.2.3-70-g09d2 From fe5f310ac6d79e3a3a455f3d87e161d78b10d307 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 1 May 2016 21:30:53 -0400 Subject: remove attachrid from lum spell --- world/map/npc/magic/level1-lesser-heal.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'world/map') diff --git a/world/map/npc/magic/level1-lesser-heal.txt b/world/map/npc/magic/level1-lesser-heal.txt index d03031d6..d195956f 100644 --- a/world/map/npc/magic/level1-lesser-heal.txt +++ b/world/map/npc/magic/level1-lesser-heal.txt @@ -33,8 +33,12 @@ L_NotMe: L_Continue: if (getskilllv(SKILL_MAGIC_DARK) >= 1) sc_start SC_HALT_REGENERATE, 2000, 0; - if (attachrid(@target_id) != 1) end; // XXX: to avoid the ugly attachrid method we would need some kind of `run_as` builtin - if (!(isdead())) heal 200, 0, 1; + if (get(Hp, @target_id) < 1) end; + addtimer 0, strnpcinfo(0) + "::OnSlowHeal", @target_id; + end; + +OnSlowHeal: + heal 200, 0, 1; end; L_Mouboo: -- cgit v1.2.3-70-g09d2 From a1339b4f44971c1a585bdca04ec8e0f2edc78dbb Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 1 May 2016 21:42:44 -0400 Subject: remove attachrid from frillyar spell --- world/map/npc/magic/level2-arrow-hail.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'world/map') diff --git a/world/map/npc/magic/level2-arrow-hail.txt b/world/map/npc/magic/level2-arrow-hail.txt index 3be14f1a..c7deb852 100644 --- a/world/map/npc/magic/level2-arrow-hail.txt +++ b/world/map/npc/magic/level2-arrow-hail.txt @@ -4,7 +4,7 @@ end; OnCast: - if(call("magic_checks")) end; + if(call("magic_checks")) end; if (getskilllv(.school) < .level) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (Sp < 25) end; @@ -65,8 +65,8 @@ OnNearbyNpc: end; OnLaunch: - if(attachrid(.caster) != 1) destroy; // destroy if caster is missing - if(getmap() != strnpcinfo(3)) destroy; // destroy if caster left the map + if(get(BL_ID, .caster) != .caster) destroy; // destroy if caster is missing + if(getmap(.caster) != strnpcinfo(3)) destroy; // destroy if caster left the map set .hit, .hit + 1; if(.hit > .max_hit) destroy; set .launch, 0; @@ -78,11 +78,11 @@ S_Launch: npcareawarp .area_x - 6, .area_y - 6, .area_x + 6, .area_y + 6, 0, strnpcinfo(0); misceffect FX_ARROW_HAIL; set .done, 0; - foreach 2, strnpcinfo(3), getnpcx(), getnpcy(), getnpcx(), getnpcy(), strnpcinfo(0) + "::OnHit"; - if (PVP_CHANNEL || getmapflag(getmap(), MF_PVP)) - foreach 0, strnpcinfo(3), getnpcx(), getnpcy(), getnpcx(), getnpcy(), strnpcinfo(0) + "::OnHit"; - if(!.done && getx() == getnpcx() && gety() == getnpcy()) - heal 0 - (.damage + rand(.damage_bonus) + rand(.damage_bonus)), 0; // injure caster + foreach 2, strnpcinfo(3), getnpcx(), getnpcy(), getnpcx(), getnpcy(), strnpcinfo(0) + "::OnHit", .caster; + if (get(PVP_CHANNEL, .caster) || getmapflag(getmap(.caster), MF_PVP)) + foreach 0, strnpcinfo(3), getnpcx(), getnpcy(), getnpcx(), getnpcy(), strnpcinfo(0) + "::OnHit", .caster; + if(!.done && get(POS_X, .caster) == getnpcx() && get(POS_Y, .caster) == getnpcy()) + set Hp, get(Hp, .caster) - (.damage + rand(.damage_bonus) + rand(.damage_bonus)), .caster; // injure caster set .launch, .launch + 1; if(.launch < 3) goto S_Launch; return; @@ -92,8 +92,8 @@ OnTimer30000: destroy; OnHit: - if(attachrid(.caster) != 1) destroy; // destroy if caster is missing - if(getmap() != strnpcinfo(3)) destroy; // destroy if caster left the map + if(get(BL_ID, .caster) != .caster) destroy; // destroy if caster is missing + if(getmap(.caster) != strnpcinfo(3)) destroy; // destroy if caster left the map if(target(.caster, @target_id, 16) != 16 && .caster != @target_id) end; if((get(BL_TYPE, @target_id) & 1) == 0) end; // either mob or pc -- cgit v1.2.3-70-g09d2