Description:
This script will protect players against server crash or restart.
It will give 60 seconds (default time) protection against physical damage and magic damage to monster->player, player->monster.
When you attack monster after server restart/crash hit's aren't display and when monster attack you hit's aren't display too (0 damage).
It can be used to make quest ex. monsters hits you for like 9000 and you can done this quest only after server restart/crash by run through monsters
__________________________________
This script will protect players against server crash or restart.
It will give 60 seconds (default time) protection against physical damage and magic damage to monster->player, player->monster.
When you attack monster after server restart/crash hit's aren't display and when monster attack you hit's aren't display too (0 damage).
It can be used to make quest ex. monsters hits you for like 9000 and you can done this quest only after server restart/crash by run through monsters
__________________________________
Add in `data/creaturescripts/creaturescripts.xml`:
XML:
<!-- Protection after server crash/restart -->
<event type="statschange" name="loginPro" event="script" value="loginPro.lua"/>
<event type="login" name="loginPro" event="script" value="loginPro.lua"/>
Create `data/creaturescripts/scripts/loginPro.lua` and put in:
Lua:
local seconds = 60
function onLogin(cid)
registerCreatureEvent(cid, "loginPro")
return true
end
function onStatsChange(cid, attacker, type, combat, value)
if getWorldUpTime() <= seconds and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then
doSendMagicEffect(getCreaturePosition(cid), 3)
return false
end
return true
end
Lua:
<script>
<event name="loginPro"/>
</script>
That's all, enjoy!
Don't forget to Like! and comment!
Don't forget to Like! and comment!
Last edited: