-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathadvance-effect.xml
35 lines (29 loc) · 1.08 KB
/
advance-effect.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?xml version="1.0" encoding="UTF-8"?>
<mod name="advance-effect" version="1.0" author="slawkens" contact="slawkens@gmail.com" enabled="yes">
<config name="advance-effect-config"><![CDATA[
-- should magic effect by displayed? Otherwise, only advance words are shown
effect = "yes"
-- magic effect id (type)
effectType = 30
]]></config>
<event type="advance" name="advance-effect-event" event="script"><![CDATA[
domodlib('advance-effect-config')
local config = {
effect = getBooleanFromString(effect),
effectType = effectType
}
function onAdvance(cid, skill, oldLevel, newLevel)
if(config.effect and newLevel % 10 == 0) then
for _, pos in pairs(getArea(getCreaturePosition(cid), 1, 1)) do
doSendMagicEffect(pos, config.effectType)
end
end
doCreatureSay(cid, SKILL_NAMES[skill]:gsub("%a", string.upper, 1) .. " UP [" .. newLevel .. "]", TALKTYPE_ORANGE_1)
return true
end
]]></event>
<event type="login" name="advance-effect-login" event="buffer"><![CDATA[
registerCreatureEvent(cid, "advance-effect-event")
_result = true
]]></event>
</mod>