-
Notifications
You must be signed in to change notification settings - Fork 9
/
arena.xml
57 lines (57 loc) · 1.79 KB
/
arena.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
53
54
55
56
57
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Arena Play Ground" enabled="yes">
<config name="arena_config"><![CDATA[
config = {
oldPosition = {
{x = 1017, y = 1020, z = 7},
{x = 1017, y = 1021, z = 7}
},
newPosition = {
{x = 1017, y = 1007, z = 7},
{x = 1025, y = 1016, z = 7}
},
arena = {
fromPos = {x = 1017, y = 1007, z = 7},
toPos = {x = 1025, y= 1016, z = 7}
}
}
]]></config>
<event type="login" name="arena_login" event="script"><![CDATA[
return registerCreatureEvent(cid, "arena_dead")
]]></event>
<event type="statschange" name="arena_dead" event="script"><![CDATA[
domodlib("arena_config")
if type == 1 and getCreatureHealth(cid) <= value and isCreature(attacker) and isPlayer(cid) then
if isInRange(getThingPos(cid), config.arena.fromPos, config.arena.toPos) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), false)
doCreatureAddMana(cid, getCreatureMaxMana(cid), false)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
return false
end
end
return true
]]></event>
<action uniqueid="1981" event="script"><![CDATA[
domodlib("arena_config")
if item.itemid == 1945 then
return doTransformItem(item.uid, 1946)
end
local players = {}
for _, old in ipairs(config.oldPosition) do
local creature = getTopCreature(old).uid
if isPlayer(creature) then
table.insert(players, creature)
end
end
if #players ~= 2 then
return doPlayerSendTextMessage(cid, 27, "You need 2 players to start.")
end
for i, player in ipairs(players) do
doSendMagicEffect(getThingPos(player), CONST_ME_POFF)
doTeleportThing(player, config.newPosition[i], true)
doSendMagicEffect(config.newPosition[i], CONST_ME_TELEPORT)
end
doTransformItem(item.uid, 1945)
return true
]]></action>
</mod>