From 8279b36fe83a9029abb29340c8230edc02d4000c Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 21:13:26 -0400 Subject: prevent sending multiple end messages for `betsanc` spell --- world/map/npc/magic/level2-protect.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'world') diff --git a/world/map/npc/magic/level2-protect.txt b/world/map/npc/magic/level2-protect.txt index 659efdc1..b68265d1 100644 --- a/world/map/npc/magic/level2-protect.txt +++ b/world/map/npc/magic/level2-protect.txt @@ -29,10 +29,12 @@ 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."; - addtimer @betsanc_time, strnpcinfo(0)+"::OnEnd", @target_id; + set @betsanc_future, gettimetick(0) + @betsanc_time - 100, @target_id; + addtimer @betsanc_time - 100, strnpcinfo(0)+"::OnEnd", @target_id; end; OnEnd: + if (gettimetick(0) - @betsanc_future < 0) end; if (sc_check(SC_PHYS_SHIELD) != 1) end; message strcharinfo(0), "Shield : You feel less protected."; misceffect FX_MAGIC_SHIELD_ENDS, strcharinfo(0); -- cgit v1.2.3-60-g2f50 From d462db3b47bc6f2bf7ad5fa9753dde63f5e77d65 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 21:17:09 -0400 Subject: prevent sending multiple end messages for `asorm` spell --- world/map/npc/magic/level2-barrier.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'world') diff --git a/world/map/npc/magic/level2-barrier.txt b/world/map/npc/magic/level2-barrier.txt index 9526ee5a..3b7ffb77 100644 --- a/world/map/npc/magic/level2-barrier.txt +++ b/world/map/npc/magic/level2-barrier.txt @@ -27,10 +27,12 @@ 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."; - addtimer @asorm_time, strnpcinfo(0)+"::OnEnd", @target_id; + set @asorm_future, gettimetick(0) + @asorm_time - 100, @target_id; + addtimer @asorm_time - 100, strnpcinfo(0)+"::OnEnd", @target_id; end; OnEnd: + if (gettimetick(0) - @asorm_future < 0) end; if (sc_check(SC_MBARRIER) != 1) end; message strcharinfo(0), "Barrier : Your magical barrier dissipates."; misceffect FX_MAGIC_DEFAULT, strcharinfo(0); -- cgit v1.2.3-60-g2f50 From bff84139891b9789a13ecee59ace2ab3def3141d Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 21:17:38 -0400 Subject: prevent sending multiple end messages for `plugh` spell --- world/map/npc/magic/level2-flying-backpack.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'world') diff --git a/world/map/npc/magic/level2-flying-backpack.txt b/world/map/npc/magic/level2-flying-backpack.txt index 87c7d644..36e936fd 100644 --- a/world/map/npc/magic/level2-flying-backpack.txt +++ b/world/map/npc/magic/level2-flying-backpack.txt @@ -22,10 +22,12 @@ 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."; - addtimer @plugh_time, strnpcinfo(0)+"::OnEnd", @target_id; + set @plugh_future, gettimetick(0) + @plugh_time - 100, @target_id; + addtimer @plugh_time - 100, strnpcinfo(0)+"::OnEnd", @target_id; end; OnEnd: + if (gettimetick(0) - @plugh_future < 0) end; if (sc_check(SC_FLYING_BACKPACK) != 1) end; message strcharinfo(0), "Backpack : Your backpack is no longer levitating."; misceffect FX_MAGIC_GENERIC, strcharinfo(0); -- cgit v1.2.3-60-g2f50 From 4656ee715ec17ba4246c826758679c3d7bd12e71 Mon Sep 17 00:00:00 2001 From: mekolat Date: Mon, 2 May 2016 16:34:40 -0400 Subject: make cast failures more verbose --- world/map/npc/magic/_procedures.txt | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'world') diff --git a/world/map/npc/magic/_procedures.txt b/world/map/npc/magic/_procedures.txt index bdeb6140..95b5cd93 100644 --- a/world/map/npc/magic/_procedures.txt +++ b/world/map/npc/magic/_procedures.txt @@ -14,7 +14,7 @@ function|script|magic_register end; OnLogin: - set @_M_BLOCK, 1; + set @_M_BLOCK, 2; addtimer 10000, "Magic Timer::OnClear"; end; @@ -26,14 +26,32 @@ OnClear: // this function is call()-only function|script|magic_checks { - set .@r, 0; - if(HIDDEN) set .@r, 1; // can not cast with @hide - if(@_M_BLOCK) set .@r, 2; // check if last debuff ended - if(Hp < 1) set .@r, 3; // can not cast when dead - if (MATK1 < 1) set .@r, 4; // can not cast with a grey mana bar - if (.@r) - smsg SMSG_FAILURE, "Magic: Impossible to cast right now."; - return .@r; + if(HIDDEN) goto L_Hidden; // can not cast with @hide + if(@_M_BLOCK == 2) goto L_Login; // login warmup + if(@_M_BLOCK) goto L_Blocked; // check if last debuff ended + if(Hp < 1) goto L_Dead; // can not cast when dead + if (MATK1 < 1) goto L_Greybar; // can not cast with a grey mana bar + return 0; + +L_Hidden: + smsg SMSG_FAILURE, "Magic: Impossible to cast while hidden!"; + return 1; + +L_Blocked: + smsg SMSG_FAILURE, "Magic: Impossible to cast while a cooldown is in effect. Please wait."; + return 2; + +L_Dead: + smsg SMSG_FAILURE, "Magic: Impossible to cast while dead!"; + return 3; + +L_Greybar: + smsg SMSG_FAILURE, "Magic: Impossible to cast with 0 m.atk. This might happen if your mana bar is grey. Some equipment can reduce your m.atk."; + return 4; + +L_Login: + smsg SMSG_FAILURE, "Magic: Impossible to cast for 10s after logging in."; + return 5; } function|script|elt_damage -- cgit v1.2.3-60-g2f50 From 92df6d13708dd5078d62f999c8f195e0ad348613 Mon Sep 17 00:00:00 2001 From: mekolat Date: Wed, 4 May 2016 09:12:14 -0400 Subject: prevent sending multiple end messages for `anwiltyp` spell --- world/map/npc/magic/level2-hide.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'world') diff --git a/world/map/npc/magic/level2-hide.txt b/world/map/npc/magic/level2-hide.txt index 6d9c125d..f720dd43 100644 --- a/world/map/npc/magic/level2-hide.txt +++ b/world/map/npc/magic/level2-hide.txt @@ -26,10 +26,12 @@ 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!"; + set @anwiltyp_future, gettimetick(0) + @anwiltyp_time - 100, @target_id; addtimer @anwiltyp_time, strnpcinfo(0)+"::OnEnd", @target_id; end; OnEnd: + if (gettimetick(0) - @anwiltyp_future < 0) end; if (sc_check(SC_HIDE) != 1) end; message strcharinfo(0), "Magic : You are no longer hidden."; misceffect FX_MAGIC_GENERIC, strcharinfo(0); -- cgit v1.2.3-60-g2f50 From 068eebc9b5b07a6b97aa8fac954f39643331b4e0 Mon Sep 17 00:00:00 2001 From: mekolat Date: Wed, 4 May 2016 09:22:52 -0400 Subject: fix bug preventing to cast betsanc with skill level < 3 --- world/map/npc/magic/level2-protect.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'world') diff --git a/world/map/npc/magic/level2-protect.txt b/world/map/npc/magic/level2-protect.txt index b68265d1..38ea6a7d 100644 --- a/world/map/npc/magic/level2-protect.txt +++ b/world/map/npc/magic/level2-protect.txt @@ -6,7 +6,6 @@ if (.@level < .level) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (.@level <= 3 && countitem("HardSpike") < 1) end; - elif (.@level <= 3) end; set @target_id, getcharid(3, @args$); if (@target_id < 1 || !(isloggedin(@target_id)) || get(INVISIBLE, @target_id)) set @target_id, BL_ID; // fallback to self @@ -15,7 +14,7 @@ if (distance(BL_ID, @target_id) >= (@spellpower/30)+2) set @target_id, BL_ID; if (get(@antiprotect, @target_id) > 0) end; - delitem "HardSpike", 1; + if (.@level <= 3) delitem "HardSpike", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 1500, "Magic Timer::OnClear"; // set the new debuff callfunc "adjust_spellpower"; -- cgit v1.2.3-60-g2f50 From b0ca99e7e6af01c884bd6be27cceedb0266b1929 Mon Sep 17 00:00:00 2001 From: mekolat Date: Wed, 4 May 2016 09:28:04 -0400 Subject: make sagatha teach about `detsanc` --- world/map/npc/013-1/sagatha.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'world') diff --git a/world/map/npc/013-1/sagatha.txt b/world/map/npc/013-1/sagatha.txt index e113d35a..fe2a4e6f 100644 --- a/world/map/npc/013-1/sagatha.txt +++ b/world/map/npc/013-1/sagatha.txt @@ -319,6 +319,9 @@ L_teach_N11: next; mes "[Sagatha the Witch]"; mes "\"Or call it into someone else's skin, by saying that someone's name right after the '" + get(.invocation$, "protect") + "'.\""; + next; + mes "[Sagatha the Witch]"; + mes "\"You can also remove this spell from yourself if you say '" + get(.invocation$, "antiprotect") + "'.\""; goto L_practice; L_teach_noexp: -- cgit v1.2.3-60-g2f50 From 46c803f09b3d100ecbc7575f750931e27280de29 Mon Sep 17 00:00:00 2001 From: mekolat Date: Wed, 4 May 2016 09:31:54 -0400 Subject: make morgan teach about `discharge` spell --- world/map/npc/029-2/morgan.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'world') diff --git a/world/map/npc/029-2/morgan.txt b/world/map/npc/029-2/morgan.txt index d5604f93..a72bfa1d 100644 --- a/world/map/npc/029-2/morgan.txt +++ b/world/map/npc/029-2/morgan.txt @@ -109,6 +109,7 @@ L_LearningDone: mes "\"" + get(.invocation$, "spell-wand") + " is a basic wand attack.\""; mes "\"A Wand must be equipped to use the spell.\""; mes "\"To cast a spell open the chat window, type the invocation and press enter.\""; + mes "\"You can also discharge any active spell by saying " + get(.invocation$, "discharge spell") + ".\""; mes "\"I've taught you all I can for now. You should visit the Mana Seed north west of Hurnscald.\""; goto L_Close; -- cgit v1.2.3-60-g2f50 From a25fa832a47e27a56be017bbb58b85ba7f072507 Mon Sep 17 00:00:00 2001 From: mekolat Date: Thu, 5 May 2016 16:12:41 -0400 Subject: fix candor ferry message --- world/map/npc/029-1/dock.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'world') diff --git a/world/map/npc/029-1/dock.txt b/world/map/npc/029-1/dock.txt index fcb27b6c..f7e38c2d 100644 --- a/world/map/npc/029-1/dock.txt +++ b/world/map/npc/029-1/dock.txt @@ -7,14 +7,6 @@ if(@npc_check) end; callfunc "BoardCandorFerry"; end; - -OnTouch: - addtimer get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnBoard"; - end; - -OnBoard: - callfunc "BoardCandorFerry"; - end; } 029-1,51,118,0|script|Candor Koga|395,8,7 @@ -24,6 +16,14 @@ OnBoard: if(@npc_check) end; callfunc "BoardCandorFerry"; end; + +OnTouch: + addtimer get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnBoard"; + end; + +OnBoard: + callfunc "BoardCandorFerry"; + end; } 029-1,55,110,0|script|#CandorDock|32767 -- cgit v1.2.3-60-g2f50