Este é o script que eu tenho, mas eu preciso dele para trabalhar quando os jogadores morrem por jogadores, não monstros como este script.
poderia me ajudar a editá-lo?
local config = {
playerCount = 9090, -- Global storage for counting the players left/entered in the event
gobletsur = 10127, -- id del premio con nombre.
templeWait = {x = 8884, y = 8470, z = 6}, --- donde los jugadores muertos iran
moneyReward = {12372, 15, 1}, -- second collumn(count) 0 if you don't want money to be used. or a stackable item you want more than 1 of.
-- Estas coordenadas deben ser exactamente las misma del script en global event!
fromPositions = {x = 8858, y = 8468, z = 7}, -- igual que en la talkaction izquierda de arriva
toPositions = {x = 8887, y = 8499, z = 7}, -- derecha de abajo
}
local Event_Start = 3032
function onStatsChange(cid, attacker, type, combat, value)
if type == STATSCHANGE_HEALTHGAIN or getCreatureHealth(cid) > value or not isCreature(attacker) then
return true
end
local isInArea = isInArea(getPlayerPosition(cid), config.fromPositions, config.toPositions)
if isInArea and isPlayer(cid) and isMonster(attacker) then
if getGlobalStorageValue(config.playerCount) >= 2 then
doBroadcastMessage(getPlayerName(cid) .. " Ah Muerto En The Free For All Event!", MESSAGE_STATUS_CONSOLE_RED)
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
doTeleportThing(cid, config.templeWait, false)
doSendMagicEffect(config.templeWait, 10)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount) - 1)
setPlayerStorageValue(cid, 97801, -1)
setPlayerStorageValue(cid, 12822, - 1) --- reconoser players que entraron
doRemoveConditions(cid, false)
elseif getGlobalStorageValue(config.playerCount) == 1 then
doBroadcastMessage(getPlayerName(cid) .. " Gano The Free For All Event! Congratulations!", MESSAGE_STATUS_WARNING)
local gobletsur = doPlayerAddItem(cid, config.gobletsur, 1)
doItemSetAttribute(gobletsur, "description", "Premio Para " .. getPlayerName(cid) .. " Por Ganar The Free For All Event.")
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
setPlayerStorageValue(cid, 97801, -1)
setPlayerStorageValue(cid, 12822, - 1) --- reconoser players que entraron
doPlayerAddItem(cid, 12372, 15)
doRemoveConditions(cid, false)
setGlobalStorageValue(Event_Start, 0)
setGlobalStorageValue(config.playerCount, 0)
end
for x = config.fromPositions.x, config.toPositions.x do
for y = config.fromPositions.y, config.toPositions.y do
for z = config.fromPositions.z, config.toPositions.z do
local areapos = {x = x, y = y, z = z, stackpos = 253}
local getMonsters = getThingfromPos(areapos)
if isMonster(getMonsters.uid) then
doRemoveCreature(getMonsters.uid)
end
end
end
end
return false
end
return true
end
resolver o meu problema, poderia fechar este post?
Pergunta
Bennyhappy 2
Este é o script que eu tenho, mas eu preciso dele para trabalhar quando os jogadores morrem por jogadores, não monstros como este script.
poderia me ajudar a editá-lo?
resolver o meu problema, poderia fechar este post?
Link para o comentário
https://xtibia.com/forum/topic/199231-preciso-ajuda-para-event/Compartilhar em outros sites
0 respostass a esta questão
Posts Recomendados