Hello Guys.
•¤• Request•¤•
http://otland.net/f132/spell-absorbpercentall-59012/
•¤• Description•¤•
All damage, which is taken in the period of time set, will be absorbed.
•¤•Effect:•¤•
Everytime the player normally would receive damage, this effect is shown. Also when the spell is cast.
•¤• Information•¤•
The exhaustion should be higher than the duration or the players have infinite protection.
If you find bug, post here. But I tested it and it worked fine.
If you know any features I can add tell me.
•¤•Script:•¤•
•¤•REP+ please!•¤•
•¤•Update:•¤•
•¤•showtext in config (1 = text is shown to the attacker and the attacked)
•¤•blockheal in config (1 = player can't even be healed, 0 = player can be healed)
•¤• Request•¤•
http://otland.net/f132/spell-absorbpercentall-59012/
•¤• Description•¤•
All damage, which is taken in the period of time set, will be absorbed.
•¤•Effect:•¤•
Everytime the player normally would receive damage, this effect is shown. Also when the spell is cast.
•¤• Information•¤•
The exhaustion should be higher than the duration or the players have infinite protection.
If you find bug, post here. But I tested it and it worked fine.
If you know any features I can add tell me.
•¤•Script:•¤•
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Protector" version="1.1" author="Summ" contact="" enabled="yes">
<config name="pro_config"><![CDATA[
config = {
lvl = 0,
mlvl = 0,
mana = 0,
duration = 10,
storage = 60400,
exhausted = 4,
storage_exhau = 60401,
blockheal = 0,
showtext = 1
}
]]></config>
<event type="login" name="ProLog" event="script"><![CDATA[
function onLogin(cid)
registerCreatureEvent(cid,"protector")
registerCreatureEvent(cid,"protectorr")
return true
end
]]></event>
<event type="combat" name="protector" event="script"><![CDATA[
domodlib('pro_config')
function onCombat(cid,target)
if isPlayer(target) == TRUE then
if os.time() <= getPlayerStorageValue(target, config.storage) then
if config.showtext == 1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You cannot hurt "..getPlayerName(target)..", because he is protected.")
doPlayerSendTextMessage(target,MESSAGE_INFO_DESCR,""..getPlayerName(cid).." tried to attack you, but you are protected.")
end
doSendMagicEffect(getPlayerPosition(target),49)
return false
end
end
return TRUE
end
]]></event>
<event type="statschange" name="protectorr" event="script"><![CDATA[
domodlib('pro_config')
function onStatsChange(cid, attacker, type, combat, value)
if not(combat == 128 and config.blockheal == 0) then
if os.time() <= getPlayerStorageValue(cid, config.storage) then
if config.showtext == 1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You could not be healed because you are protected.")
end
doSendMagicEffect(getPlayerPosition(cid),49)
return false
end
end
return true
end
]]></event>
<talkaction words="protector" event="script"><![CDATA[
domodlib('pro_config')
function onSay(cid, words, param, channel)
if getPlayerLevel(cid) < config.lvl then
doPlayerSendCancel(cid,"Your level is too low.")
doSendMagicEffect(getPlayerPosition(cid),2)
return true
end
if getPlayerMagLevel(cid) < config.mlvl then
doPlayerSendCancel(cid,"Your magic level is too low.")
doSendMagicEffect(getPlayerPosition(cid),2)
return true
end
if getCreatureMana(cid) < config.mana then
doPlayerSendCancel(cid,"You do not have enough mana.")
doSendMagicEffect(getPlayerPosition(cid),2)
return true
end
if os.time() <= getPlayerStorageValue(cid,config.storage_exhau) and not(getPlayerStorageValue(cid,config.storage_exhau) < 5) then
doPlayerSendCancel(cid,"You can use this spell only once in "..config.exhausted.." seconds.")
doSendMagicEffect(getPlayerPosition(cid),2)
return true
else
setPlayerStorageValue(cid,config.storage,(os.time()+config.duration))
setPlayerStorageValue(cid,config.storage_exhau,(os.time()+config.exhausted))
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You are protected for "..config.duration.." seconds now.")
doSendMagicEffect(getPlayerPosition(cid),49)
doPlayerAddSpentMana(cid,config.mana)
end
return false
end
]]></talkaction>
</mod>
•¤•REP+ please!•¤•
•¤•Update:•¤•
•¤•showtext in config (1 = text is shown to the attacker and the attacked)
•¤•blockheal in config (1 = player can't even be healed, 0 = player can be healed)
Last edited: