summaryrefslogtreecommitdiff
path: root/world/map/npc/magic/_procedures.txt
diff options
context:
space:
mode:
authorWushin <pasekei@gmail.com>2016-05-11 16:50:15 -0500
committerWushin <pasekei@gmail.com>2016-05-11 16:50:15 -0500
commit6fb28669713684116e3598cbfad078bffb7f0531 (patch)
treed478ccf6e0ed83ab1e6aa59f09b74f14c55dd0cc /world/map/npc/magic/_procedures.txt
parent9218cfaba1337e0098f147cd58d0496bdaf14728 (diff)
parenta25fa832a47e27a56be017bbb58b85ba7f072507 (diff)
downloadserverdata-6fb28669713684116e3598cbfad078bffb7f0531.tar.gz
serverdata-6fb28669713684116e3598cbfad078bffb7f0531.tar.bz2
serverdata-6fb28669713684116e3598cbfad078bffb7f0531.tar.xz
serverdata-6fb28669713684116e3598cbfad078bffb7f0531.zip
Merge pull request #496 from mekolat/end-message
a bit of everything
Diffstat (limited to 'world/map/npc/magic/_procedures.txt')
-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