summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoraK-FDF <horak-fdf@web.de>2023-09-13 21:30:46 +0200
committerHoraK-FDF <horak-fdf@web.de>2023-09-13 21:30:46 +0200
commita037e40b1a4b1b0c5603fe4572fb033987fabb2c (patch)
tree8b9d3e48e47451c1d6e36a3e5132700e89be8d9a
parenta3d53b245187db8ed4f8aa569ac60e29008a8206 (diff)
downloadserverdata-a037e40b1a4b1b0c5603fe4572fb033987fabb2c.tar.gz
serverdata-a037e40b1a4b1b0c5603fe4572fb033987fabb2c.tar.bz2
serverdata-a037e40b1a4b1b0c5603fe4572fb033987fabb2c.tar.xz
serverdata-a037e40b1a4b1b0c5603fe4572fb033987fabb2c.zip
fluffys 2023 v1 magic
-rw-r--r--world/map/npc/magic/event-summon-managuardian.txt14
-rw-r--r--world/map/npc/magic/event-summon-manatyrant.txt14
-rw-r--r--world/map/npc/magic/level2-arrow-hail.txt19
-rw-r--r--world/map/npc/magic/level2-magic-knuckles.txt75
4 files changed, 104 insertions, 18 deletions
diff --git a/world/map/npc/magic/event-summon-managuardian.txt b/world/map/npc/magic/event-summon-managuardian.txt
index 0d3d2d0b..cf47b22e 100644
--- a/world/map/npc/magic/event-summon-managuardian.txt
+++ b/world/map/npc/magic/event-summon-managuardian.txt
@@ -10,7 +10,8 @@ OnCast:
if (getskilllv(SKILL_MAGIC) < .level) end;
if (countitem("TinyManaElixir") < 1) end;
if (!$DOOMSDAY_SUMMON) end;
- if (@ddcooldown > gettimetick(2)) goto L_Cooldown;
+// if (@ddcooldown > gettimetick(2)) goto L_Cooldown;
+ if (sc_check (SC_COOLDOWN_MG)) goto L_Cooldown;
if (getmap() == "033-1") goto L_SpecialRules6;
goto L_Pay;
@@ -18,6 +19,7 @@ L_Pay:
delitem "TinyManaElixir", 1;
set @_M_BLOCK, 1; // block casting, until the timer clears it
addtimer 15000, "Magic Timer::OnClear"; // set the new debuff
+ sc_start SC_COOLDOWN, 15000, 0, BL_ID;
callfunc "adjust_spellpower";
set Sp, Sp - 100;
misceffect FX_MAGIC_MAGGOT_CAST, strcharinfo(0);
@@ -27,7 +29,8 @@ L_Pay:
if (.@puppet < 1) end;
set .master, BL_ID, .@puppet;
set .lifetime, (@spellpower*9)+60000, .@puppet;
- set @ddcooldown, gettimetick(2)+70; // This is measured in seconds
+// set @ddcooldown, gettimetick(2)+70; // This is measured in seconds
+ sc_start SC_COOLDOWN_MG, (@spellpower*9)+70000, 0, BL_ID; // .lifetime + OnSummon
addnpctimer 10000, .@puppet$+"::OnSummon";
addnpctimer 11000, .@puppet$+"::OnDestroy";
end;
@@ -47,7 +50,7 @@ OnDestroy:
destroy;
S_SummonAll:
- summon .@map$, rand(.@x-2,.@x+2), rand(.@y-2,.@y+2), .master, 1138, 2, .lifetime;
+ summon .@map$, rand(.@x-2,.@x+2), rand(.@y-2,.@y+2), .master, "Mana Guardian Summon", 1138, 2, .lifetime;
destroy;
L_Cooldown:
@@ -56,8 +59,9 @@ L_Cooldown:
L_SpecialRules6:
if ($@KIMARR_EVENT < 1) goto L_Pay;
- if ($@Fluffy_FighterID == BL_ID) goto L_Pay;
- message strcharinfo(0), "You can't summon here unless hunting fluffies.";
+ //if ($@Fluffy_FighterID == BL_ID) goto L_Pay;
+ //message strcharinfo(0), "You can't summon here unless hunting fluffies.";
+ message strcharinfo(0), "You can't use this spell here.";
end;
OnInit:
diff --git a/world/map/npc/magic/event-summon-manatyrant.txt b/world/map/npc/magic/event-summon-manatyrant.txt
index 73ee6537..4ac0773c 100644
--- a/world/map/npc/magic/event-summon-manatyrant.txt
+++ b/world/map/npc/magic/event-summon-manatyrant.txt
@@ -9,7 +9,8 @@ OnCast:
if (Sp < 100) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
if (countitem("LargeManaElixir") < 1) end;
- if (@dd4cooldown > gettimetick(2)) goto L_Cooldown;
+// if (@dd4cooldown > gettimetick(2)) goto L_Cooldown;
+ if (sc_check(SC_COOLDOWN_MT)) goto L_Cooldown;
if (getmap() == "033-1") goto L_SpecialRules6;
goto L_Pay;
@@ -17,6 +18,7 @@ L_Pay:
delitem "LargeManaElixir", 1;
set @_M_BLOCK, 1; // block casting, until the timer clears it
addtimer 15000, "Magic Timer::OnClear"; // set the new debuff
+ sc_start SC_COOLDOWN, 15000, 0, BL_ID;
callfunc "adjust_spellpower";
set Sp, Sp - 100;
misceffect FX_MAGIC_MAGGOT_CAST, strcharinfo(0);
@@ -26,7 +28,8 @@ L_Pay:
if (.@puppet < 1) end;
set .master, BL_ID, .@puppet;
set .lifetime, (@spellpower*9)+150000, .@puppet;
- set @dd4cooldown, gettimetick(2)+160; // This is measured in seconds
+// set @dd4cooldown, gettimetick(2)+160; // This is measured in seconds
+ sc_start SC_COOLDOWN_MT, (@spellpower*9)+160000, 0, BL_ID; // .lifetime + OnSummon
addnpctimer 10000, .@puppet$+"::OnSummon";
addnpctimer 11000, .@puppet$+"::OnDestroy";
// Causes caster to heal (I thought in converting MP to HP but meh)
@@ -48,7 +51,7 @@ OnDestroy:
destroy;
S_SummonAll:
- summon .@map$, rand(.@x-2,.@x+2), rand(.@y-2,.@y+2), .master, 1150, 2, .lifetime;
+ summon .@map$, rand(.@x-2,.@x+2), rand(.@y-2,.@y+2), .master, "Mana Tyrant Summon", 1150, 2, .lifetime;
destroy;
L_Cooldown:
@@ -57,8 +60,9 @@ L_Cooldown:
L_SpecialRules6:
if ($@KIMARR_EVENT < 1) goto L_Pay;
- if ($@Fluffy_FighterID == BL_ID) goto L_Pay;
- message strcharinfo(0), "You can't summon here unless hunting fluffies.";
+ //if ($@Fluffy_FighterID == BL_ID) goto L_Pay;
+ //message strcharinfo(0), "You can't summon here unless hunting fluffies.";
+ message strcharinfo(0), "You can't use this spell here.";
end;
OnInit:
diff --git a/world/map/npc/magic/level2-arrow-hail.txt b/world/map/npc/magic/level2-arrow-hail.txt
index 4ebcba85..1a6d61b9 100644
--- a/world/map/npc/magic/level2-arrow-hail.txt
+++ b/world/map/npc/magic/level2-arrow-hail.txt
@@ -15,7 +15,7 @@ OnCast:
elif (countitem("IronArrow") >= 20 && countitem("SulphurPowder") >= 1) goto L_Continue;
else end;
goto L_Continue;
-
+
L_Continue:
if (getmap() == "033-1") goto L_SpecialRules6;
goto L_Pay;
@@ -27,6 +27,8 @@ L_Pay:
set Sp, Sp - 25;
set @_M_BLOCK, 1; // block casting, until the timer clears it
addtimer 5000, "Magic Timer::OnClear"; // set the new debuff
+ sc_start SC_COOLDOWN, 5000, 0, BL_ID;
+ sc_start SC_COOLDOWN_AR, 30000, 0, BL_ID; // Set it to lenght of timeout
setarray @away[0], POS_X, POS_Y, getdir(), (.range + 1), 0;
callsub S_AwayFrom;
@@ -79,7 +81,10 @@ OnLaunch:
if(get(Hp, .caster) < 1) 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;
+ if(.hit > .max_hit) goto L_Destroy;
+ goto L_Launch;
+
+L_Launch:
set .launch, 0;
callsub S_Launch;
addnpctimer 250 + rand(50) + rand(50), strnpcinfo(0)+"::OnLaunch"; // loop until max
@@ -96,8 +101,13 @@ S_Launch:
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;
+L_Destroy:
+ if (attachrid(.caster)) sc_end SC_COOLDOWN_AR;
+ destroy;
+
OnTimer30000:
debugmes "frillyar timeout! [this shouldn't happen]";
destroy;
@@ -118,8 +128,9 @@ OnHit:
L_SpecialRules6:
if ($@KIMARR_EVENT < 1) goto L_Pay;
- if ($@Fluffy_FighterID == BL_ID) goto L_Pay;
- message strcharinfo(0), "You can't use this spell here unless hunting fluffies.";
+ //if ($@Fluffy_FighterID == BL_ID) goto L_Pay;
+ //message strcharinfo(0), "You can't use this spell here unless hunting fluffies.";
+ message strcharinfo(0), "You can't use this spell here.";
end;
OnInit:
diff --git a/world/map/npc/magic/level2-magic-knuckles.txt b/world/map/npc/magic/level2-magic-knuckles.txt
index 2063ad12..c072671a 100644
--- a/world/map/npc/magic/level2-magic-knuckles.txt
+++ b/world/map/npc/magic/level2-magic-knuckles.txt
@@ -1,23 +1,34 @@
-|script|magic-knuckles|32767
{
+ if @_U_BLOCK >= 1 goto L_Still_Exhausted;
if (call("magic_checks")) end;
if (Sp < 20) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
set .@level, getskilllv(.school);
if (.@level < .level) end;
if (getequipid(equip_hand1) != -1 || getequipid(equip_hand2) != -1) end;
- if (.@level <= 3 && countitem("Beer") >= 1) delitem "Beer", 1;
+ if (.@level <= 3 && countitem("Beer") >= 1) goto L_Continue;
elif (.@level <= 3) end;
+ goto L_Continue;
+
+L_Continue:
+ if (getmap() == "033-1") goto L_SpecialRules6;
+ goto L_Pay;
+
+L_Pay:
+ delitem "Beer", 1;
set @_M_BLOCK, 1; // block casting, until the timer clears it
addtimer 500, "Magic Timer::OnClear"; // set the new debuff
+ sc_start SC_COOLDOWN, 500, 0, BL_ID;
callfunc "adjust_spellpower";
set Sp, Sp - 20;
+ set .caster, getcharid(3);
misceffect FX_MAGIC_KNUCKLE_CAST, strcharinfo(0);
setarray @upmarmuspell[0],
max(1, BASE_ATK - 100 + min(100, Int)), // dmg
((@spellpower/10) + ((Dex * 8)/(sqrt(BaseLevel + 34)) + 20)), // charges (you get more at lower levels)
- (sqrt(300 - (Agi * 2)) + (5/2)), // delay
- ((Agi + Int) / 2), // dmg bonus
+ (sqrt(190) * 25 / 20), // delay - see conf/battle_athena.conf @ max_aspd
+ ((Agi + Int) * 2 / 5), // dmg bonus
(((BaseLevel/5) + Str) * 2); // do not allow to equip light armor, cast, and then switch to heavy armor to get bonus str
callfunc "magic_exp";
goto L_FreeRecast;
@@ -26,7 +37,20 @@ OnAttack:
if (getequipid(equip_hand1) != -1 || getequipid(equip_hand2) != -1) goto OnDischarge;
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);
+
+ // This timer is if you stopped somewhere below max hits then after 25sec you recover fully and start at 0 hits again
+ stopnpctimer;
+ // to get this work stoptimer must be executed here or after setnpctimer and then started again else
+ // a timer somehow detaches that cant be set anymore, startnpctimer then attaches it again somehow
+ // i think the problem is in npc_timerevent_calc_next somewhere
+ if (@num_upmarmu_hits < 1) initnpctimer;
+ setnpctimer 0;
+ startnpctimer;
+
set @upmarmuspell[1], @upmarmuspell[1] - 1;
+ set @num_upmarmu_hits, @num_upmarmu_hits + 1;
+
+ if @num_upmarmu_hits > UPMARMU_HITS_TILL_EXHAUST goto L_Exhausted;
goto L_FreeRecast;
L_FreeRecast:
@@ -34,17 +58,50 @@ L_FreeRecast:
addtimer 0, strnpcinfo(0) + "::OnSetRecast";
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:
+ stopnpctimer;
+ setnpctimer 0;
+ end;
+
OnDischarge:
if (@upmarmuspell[1] < 1) end;
set @upmarmuspell[1], 0;
misceffect FX_MAGIC_DISCHARGE, strcharinfo(0);
overrideattack;
- end;
+ goto L_StopTimer;
OnSetRecast:
overrideattack (@upmarmuspell[2] * @upmarmuspell[2]), 1, ATTACK_ICON_GENERIC, OVERRIDE_KNUCKLES, strnpcinfo(0)+"::OnAttack", @upmarmuspell[1]; // delay needs to be squared
end;
+OnTimer25000:
+ if (attachrid(.caster) < 1) end;
+ smsg SMSG_FAILURE, "Magic: You fully recovered and can use max hits again.";
+ set @num_upmarmu_hits, 0;
+ detachrid;
+ goto L_StopTimer;
+
+L_SpecialRules6:
+ if ($@KIMARR_EVENT < 1) goto L_Pay;
+ //if ($@Fluffy_FighterID == BL_ID) goto L_Pay;
+ //message strcharinfo(0), "You can't use this spell here unless hunting fluffies.";
+ message strcharinfo(0), "You can't use this spell here.";
+ end;
+
OnInit:
set .school, SKILL_MAGIC_WAR;
set .invocation$, chr(MAGIC_SYMBOL) + "upmarmu"; // used in npcs that refer to this spell
@@ -53,3 +110,13 @@ OnInit:
set .exp_gain, 1;
end;
}
+
+-|script|Upmarmu Exhaust Timer|32767
+{
+ end;
+
+OnClear:
+ set @_U_BLOCK, 0;
+ set @num_upmarmu_hits, 0;
+ end;
+}