summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-05-02 16:34:40 -0400
committermekolat <mekolat@users.noreply.github.com>2016-05-03 20:21:42 -0400
commit4656ee715ec17ba4246c826758679c3d7bd12e71 (patch)
treebe2fe90345c38a5bd1197920d579ca88dd50391c
parentbff84139891b9789a13ecee59ace2ab3def3141d (diff)
downloadserverdata-4656ee715ec17ba4246c826758679c3d7bd12e71.tar.gz
serverdata-4656ee715ec17ba4246c826758679c3d7bd12e71.tar.bz2
serverdata-4656ee715ec17ba4246c826758679c3d7bd12e71.tar.xz
serverdata-4656ee715ec17ba4246c826758679c3d7bd12e71.zip
make cast failures more verbose
-rw-r--r--world/map/npc/magic/_procedures.txt36
1 files changed, 27 insertions, 9 deletions
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