Sheyki
Advanced User
- Joined
- Jan 23, 2011
- Messages
- 188
- Reaction score
- 8
Prosty skrypt dodaj?cy bonusowe do?wiadczenie po zabiciu potwora. Dostajemy mi?dzy x% a y% dodatkowego expa i mamy z% szans na to, ?e je wgl dostaniemy.
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Bonus Exp" version="1.0" author="Sheyki" contact="GG: 7050674" enabled="yes">
<config name="cfg"><![CDATA[
cfgBExp = {
bonusMin = 5, -- min % of bonus
bonusMax = 15, -- max % of bonus
bonusChance = 50 -- chance to get bonus
}
]]></config>
<!-- Bonus Experience (registering event) -->
<event type="login" name="PlayerLogin" event="script"><![CDATA[
function onLogin(cid)
registerCreatureEvent(cid, "BonusExp")
return TRUE
end
]]></event>
<!-- Bonus Experience -->
<event type="kill" name="BonusExp" event="script"> <![CDATA[
domodlib('cfg')
function onKill(cid, target)
if math.random(1, 100) <= cfgBExp.bonusChance then
local bexp = getMonsterInfo(getCreatureName(target)).experience*math.random(cfgBExp.bonusMin, cfgBExp.bonusMax)/100
local bexpC = math.ceil(bexp)
doPlayerAddExperience(cid, bexpC)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, bexpC .." bonus experience!")
end
return TRUE
end
]]></event>
</mod>
Zabraniam kopiowania zawarto?ci na inne fora/serwisy.
Notka moderatorska: |
+10 pkt do konkursu! |