• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Protection after server-crash/restart against players die

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,838
Solutions
18
Reaction score
617
Location
Poland
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 :D
__________________________________​

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
You must add to `monster` file ex. wolf.xml:
Lua:
 <script>
  <event name="loginPro"/>
 </script>

That's all, enjoy!
Don't forget to Like! and comment! ;)
 
Last edited:
Yup, its really doesnt working

Only works for monsters (monsters cannot hit you, also u can hit monster)
 
You must add to monster file under <flags></flags>:
Lua:
 <script>
  <event name="loginPro"/>
 </script>
 
ha lol xd monster file .xml is Hmmm? 2000 files .xml??? And all to the file i need to add script..
Meybe that work but sorry because i don't want edit all that files
 
Back
Top