Hello.. ^_^
About Zombie event.
The zombies are hitting me down to 0 hp, but i'm not dead, i can still move with 0 hp. But if i enter the teleport that leads to temple i die immediatly.
How can i fix this bug?
creaturescript.lua
login.lua
creaturescript.xml
I'll REP YOU!
Please help.
About Zombie event.
The zombies are hitting me down to 0 hp, but i'm not dead, i can still move with 0 hp. But if i enter the teleport that leads to temple i die immediatly.
How can i fix this bug?
creaturescript.lua
Code:
local temple = {x=1000, y=1000, z=7}
local t = {
items = {11234, 11237, 11238, 2514, 2472, 2470, 7405, 7453, 7431, 6433, 2542, 6391, 3972, 8918, 5903},
exp = 10000000
}
local config = {
arena = {
frompos = {x = 1131, y = 913, z =7},
topos = {x = 1161, y = 930, z=7}
}
}
function onPrepareDeath(cid, deathList)
if (isInRange(getCreaturePosition(cid), config.arena.frompos, config.arena.topos)) then
if (isMonster(deathList[1]) and isPlayer(cid)) then
if (getCreatureName(deathList[1]) == "Deadly Zombie") then
if #getPlayersfromArea(config.arena.frompos, config.arena.topos) == 1 then
doTeleportThing(cid, temple)
doSendMagicEffect(getCreaturePosition(cid),10)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Congratulations, you won! Enjoy your reward!")
doBroadcastMessage("Congratulations! ".. getCreatureName(cid) .." won Deadly Zombie arena event! This event is over, next event after approximately 2 hours.", MESSAGE_EVENT_ADVANCE)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), CONST_ME_MAGIC_BLUE, TEXTCOLOR_BLUE, true)
local v = math.random(1, 15)
if v < 15 then
doPlayerAddItem(cid, t.items[math.random(#t.items)], 1)
else
doPlayerAddExp(cid, t.exp)
end
else
doTeleportThing(cid, temple)
doSendMagicEffect(getCreaturePosition(cid),10)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You got owned!")
doBroadcastMessage("".. getCreatureName(cid) .." got owned and was kicked from arena.", MESSAGE_EVENT_ADVANCE)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), CONST_ME_MAGIC_BLUE, TEXTCOLOR_BLUE, true)
return false
end
end
elseif isPlayer(deathList[1]) and isPlayer(cid) and isInRange(getCreaturePosition(cid), config.arena.frompos, config.arena.topos) then
doTeleportThing(cid, temple)
doSendMagicEffect(getCreaturePosition(cid),10)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You got owned by playa!")
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), CONST_ME_MAGIC_BLUE, TEXTCOLOR_BLUE, true)
return false
end
else
return true
end
return false
end
login.lua
Code:
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "deadlyArena")
creaturescript.xml
HTML:
<event type="preparedeath" name="deadlyArena" event="script" value="deadlyArena.lua"/>
I'll REP YOU!
Please help.