summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-06-23 01:02:00 -0300
committerJesusaves <cpntb1@ymail.com>2020-06-23 01:02:00 -0300
commit9701df54795ff74f23391a259edb29196d0fbd4f (patch)
treeb4096af0383bb3b26bc7a97a7b01a619bc64c283 /npc/functions
parentac6c384e7b035378611808e4eb4346659104f4fe (diff)
downloadserverdata-9701df54795ff74f23391a259edb29196d0fbd4f.tar.gz
serverdata-9701df54795ff74f23391a259edb29196d0fbd4f.tar.bz2
serverdata-9701df54795ff74f23391a259edb29196d0fbd4f.tar.xz
serverdata-9701df54795ff74f23391a259edb29196d0fbd4f.zip
First sketch of areaharm()
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/filters.txt42
-rw-r--r--npc/functions/hub.txt27
2 files changed, 58 insertions, 11 deletions
diff --git a/npc/functions/filters.txt b/npc/functions/filters.txt
index cec7a15af..f47c16beb 100644
--- a/npc/functions/filters.txt
+++ b/npc/functions/filters.txt
@@ -62,6 +62,48 @@ function script filter_sameguildorpartynotyou {
return ((getcharid(1) > 0 && .@party) || (getcharid(2) > 0 && .@guild));
}
+// filter_hostile( id )
+function script filter_hostile {
+ debugmes "filter_hostile %d", getarg(0);
+ .@type=getunitdata(getarg(0), UDT_TYPE);
+ .@chkid=getarg(0);
+
+ debugmes "filter_hostile: Checking %d (BL %d)", getarg(0), .@type;
+
+ // Monsters
+ if (.@type == BL_MOB)
+ return true;
+
+ // NPCs
+ if (.@type == BL_NPC)
+ return false;
+
+ // Homunculus
+ if (.@type == BL_HOM)
+ .@chkid=charid2rid(getunitdata(getarg(0), UDT_MASTERCID));
+
+ // Pets
+ if (.@type == BL_PET)
+ .@chkid=getunitdata(getarg(0), UDT_MASTERAID);
+
+ // Mercenaries
+ if (.@type == BL_MER)
+ .@chkid=charid2rid(getunitdata(getarg(0), UDT_MASTERCID));
+
+ // Elementals
+ if (.@type == BL_ELEM)
+ .@chkid=charid2rid(getunitdata(getarg(0), UDT_MASTERCID));
+
+ debugmes "filter_hostile: Filtering %d (original %d) (BL %d)", .@chkid, getarg(0), .@type;
+ // Players (and slaves)
+ return !(filter_sameguildorparty(.@chkid));
+}
+
+// filter_friendly( id )
+function script filter_friendly {
+ return !(filter_hostile(.@chkid));
+}
+
// filter_notboss( id )
function script filter_notboss {
// 32 = MD_BOSS
diff --git a/npc/functions/hub.txt b/npc/functions/hub.txt
index eade2a4d5..eb5a1f63c 100644
--- a/npc/functions/hub.txt
+++ b/npc/functions/hub.txt
@@ -305,7 +305,8 @@ function script HUB_SkillInvoke {
debugmes "Target: %d (%d,%d)", @skillTarget, @skillTargetX, @skillTargetY;
areasc2(getmap(), @skillTargetX, @skillTargetY, 2, 10000, SC_BLOODING, BL_MOB|BL_PC);
.@dmg=AdjustSpellpower(300);
- harm(@skillTarget, .@dmg, HARM_MAGI, Ele_Holy);
+ //harm(@skillTarget, .@dmg, HARM_MAGI, Ele_Holy);
+ areaharm(@skillTarget, 8, .@dmg, HARM_MAGI, Ele_Holy);
break;
/*
case TMW2_MANABOMB:
@@ -314,14 +315,14 @@ function script HUB_SkillInvoke {
// And is a trick. Each level improves ratio in 1
// Has no cooldown, so it is powerful with pots
// And is a good starter offensive skill
- harm(@skillTarget, Sp*@skillLv, HARM_MAGI, Ele_Ghost);
+ areaharm(@skillTarget, 0, Sp*@skillLv, HARM_MAGI, Ele_Ghost);
Sp=0;
break;
// Weapon Overload attack
case TMW2_OVERLOAD:
.@PW=67+(33*@skillLv);
- harm(@skillTarget, AdjustAttackpower(.@PW), HARM_MISC);
+ areaharm(@skillTarget, 0, AdjustAttackpower(.@PW), HARM_MISC);
break;
// TODO: Ultimate Skills (T5/0)
@@ -340,9 +341,9 @@ function script HUB_SkillInvoke {
harm(@skillTarget, -AdjustSpellpower(.@PW), HARM_MISC);
break;
case TMW2_MAGNUSHEAL:
- // TODO: Area healing
+ // Area healing
.@PW=200+(20*@skillLv);
- harm(@skillTarget, -AdjustSpellpower(.@PW), HARM_MISC);
+ areaharm(@skillTarget, 4, -AdjustSpellpower(.@PW), HARM_MISC, "filter_friendly");
break;
// Provoke: builtin, Mass Provoke: See above
@@ -356,14 +357,12 @@ function script HUB_SkillInvoke {
break;
case TMW2_FIREBALL:
.@PW=140+(10*@skillLv);
- // TODO: areaharm()
- harm(@skillTarget, AdjustSpellpower(.@PW), HARM_MAGI, Ele_Fire);
+ areaharm(@skillTarget, 3, AdjustSpellpower(.@PW), HARM_MAGI, Ele_Fire);
break;
case TMW2_ARMAGEDDON:
.@PW=140+(10*@skillLv);
- // TODO: areaharm()
areasc2(getmap(), @skillTargetX, @skillTargetY, 2, 10000, SC_BLOODING, BL_MOB|BL_PC);
- harm(@skillTarget, AdjustSpellpower(.@PW), HARM_MAGI, Ele_Fire);
+ areaharm(@skillTarget, 8, AdjustSpellpower(.@PW), HARM_MAGI, Ele_Fire);
break;
case TMW2_FROSTDIVER:
@@ -377,9 +376,15 @@ function script HUB_SkillInvoke {
// TODO: All this in area
// 8% chance, 10s
sc_start SC_FREEZE, 10000, 1, 800, flag?, @skillTarget;
- harm(@skillTarget, AdjustSpellpower(.@PW), HARM_MAGI, Ele_Water);
+ areaharm(@skillTarget, 6, AdjustSpellpower(.@PW), HARM_MAGI, Ele_Water);
+ break;
+ case TMW2_NILFHEIM:
+ // FIXME SK_Nilfheim
+ // Nilfheim cast on self?
+ .@PW=80+(10*@skillLv);
+ areasc(8, 10000, SC_FREEZE, BL_PC | BL_MOB | BL_MER | BL_HOM, "filter_hostile"); // Maybe filter_notme() would work better, indeed
+ areaharm(getcharid(3), 8, AdjustSpellpower(.@PW), HARM_MAGI, Ele_Water);
break;
- // FIXME SK_Nilfheim
case TMW2_MAGICSTRIKE:
case TMW2_LIGHTNINGBOLT: