summaryrefslogtreecommitdiff
path: root/world/map/npc/magic
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-04-23 14:32:26 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-23 14:32:26 -0400
commit95e60123d75ca265c0c689fce88e82654d9fbb5a (patch)
tree2c0e6f606a3c89f5c1f58021caee9eec0dde55ed /world/map/npc/magic
parentcab5e80475f0fa1370b8587c519bb6b6b7c6190a (diff)
downloadserverdata-95e60123d75ca265c0c689fce88e82654d9fbb5a.tar.gz
serverdata-95e60123d75ca265c0c689fce88e82654d9fbb5a.tar.bz2
serverdata-95e60123d75ca265c0c689fce88e82654d9fbb5a.tar.xz
serverdata-95e60123d75ca265c0c689fce88e82654d9fbb5a.zip
prevent magic rate abuse (10s block on login)
Diffstat (limited to 'world/map/npc/magic')
-rw-r--r--world/map/npc/magic/_procedures.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/world/map/npc/magic/_procedures.txt b/world/map/npc/magic/_procedures.txt
index 466d8ca8..d3c63bf7 100644
--- a/world/map/npc/magic/_procedures.txt
+++ b/world/map/npc/magic/_procedures.txt
@@ -12,6 +12,12 @@ function|script|magic_register
-|script|Magic Timer|32767
{
end;
+
+OnLogin:
+ set @_M_BLOCK, 1;
+ addtimer 10000, "Magic Timer::OnClear";
+ end;
+
OnClear:
set @_M_BLOCK, 0;
end;
@@ -24,6 +30,8 @@ function|script|magic_checks
if(getpvpflag(1)) set .@r, 1; // FIXME: make HIDDEN into a param
if(@_M_BLOCK) set .@r, 2; // check if last debuff ended
if(Hp < 1) set .@r, 3; // can not cast when dead
+ if (.@r)
+ smsg SMSG_FAILURE, "Magic: Impossible to cast right now.";
return .@r;
}