-
Notifications
You must be signed in to change notification settings - Fork 9
/
adori-sum.xml
52 lines (45 loc) · 1.81 KB
/
adori-sum.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version="1.0" encoding="UTF-8"?>
<mod name="adori-sum" version="1.0" author="slawkens" contact="slawkens@gmail.com" enabled="yes">
<config name="adori-sum-config"><![CDATA[
excluded = {} -- these runes will be excluded from merging
]]></config>
<instant name="Merge runes" words="adori sum" lvl="15" mana="100" soul="3" aggressive="0" selftarget="1" exhaustion="1000" event="script">
<text><![CDATA[
domodlib('adori-sum-config')
local config = {
excluded = excluded
}
function onCastSpell(cid, var)
local rightRune = getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
local leftRune = getPlayerSlotItem(cid, CONST_SLOT_LEFT)
if(not isItemRune(rightRune.itemid) or not isItemRune(leftRune.itemid)
or isInArray(config.excluded, rightRune.itemid) or isInArray(config.excluded, leftRune.itemid)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return false
end
if(rightRune.itemid ~= leftRune.itemid) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return false
end
if(rightRune.type >= 100) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return false
end
local _newtype = rightRune.type + leftRune.type
if(_newtype <= 100) then
doChangeTypeItem(rightRune.uid, _newtype)
doRemoveItem(leftRune.uid, 1)
else
doChangeTypeItem(rightRune.uid, 100)
doChangeTypeItem(leftRune.uid, _newtype - 100)
end
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
return true
end
]]></text>
<vocation id="1-8"/>
</instant>
</mod>