Seja mais claro no seu pedido.
info
Grupo: Visconde
Registrado: 13/10/11
Posts: 411
Reputação: +65

info
Grupo: Artesão
Registrado: 10/11/11
Posts: 118
Reputação: +2

emm é um evento do último sobrevivente, quando entram no evento, eles são atribuídos, um globalevent, Eu preciso que quando um jogador morre no evento, em area frompos , topos, >= 2 global storage, teleport para uma área, e cuando vaia globalstorage == 1 teleported a temple e receber um prêmio, e remover monstros na área, frompos, topos
bump
info
Grupo: Cavaleiro
Registrado: 19/06/11
Posts: 195
Reputação: +14
Char no Tibia: Desconhecido

Explique mais claramente ![]()
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

Explique mais claramente
Tome cuidado com este tipo de post @KUNGLOW ele ja tinha especificado como queria acima
info
Grupo: Cavaleiro
Registrado: 19/06/11
Posts: 195
Reputação: +14
Char no Tibia: Desconhecido

Sim, mas você conseguiu entender?
info
Grupo: Artesão
Registrado: 10/11/11
Posts: 118
Reputação: +2

info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: No Have

Vamos relembrar que flood e todo o post que serve apenas para aumentar a posição do tópico ou o numero do post do usuário
Script:
function onDeath(cid, corpse, killers)
local globalStorage = getStorage(500)
if globalStorage == -1 then return true end
local frompos = {x = 100, y = 100, z = 7}
local topos = {x = 110, y = 110, z = 7}
local isInArea = false
local ppos = getThingPos(cid)
if ppos.x >= frompos.x and ppos.x <= topos.x and
ppos.y >= frompos.y and ppos.y <= topos.y and ppos.z = frompos.z then
isInArea = true
end
if isInArea and globalStorage >= 2 then
local teleportPosition = {x = 700, y = 700, z = 7}
doTeleportThing(cid, teleportPosition)
doSendMagicEffect(teleportPosition, CONST_ME_TELEPORT)
doSetStorage(globalStorage, -1)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
return false
end
if isInArea and globalStorage == 1 then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerAddItem(cid, 2160, 100)
doSetStorage(globalStorage, -1)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
for x = frompos.x, topos.x do
for y = frompos.y, topos.y do
local p = {x = x, y = y, z = frompos.z}
local c = getTopCreature(p).uid
if c > 1 and isMonster(c) then
doRemoveCreature(c)
end
end
end
return false
end
return true
end
Não testado
Precisa adicionar a tag em creaturescripts.xml e registrar o evento no player em login.lua
Se você souber inglês, escreva seu pedido tanto em português quanto em inglês, aumenta a chance de alguém entender o que você quer
info
Grupo: Artesão
Registrado: 10/11/11
Posts: 118
Reputação: +2

nao funciono, me ajuda reparar este? nao remove monsters.
help me repair this script maket by me, no remove monster, and crash server on death on area ![]()
local config = {
playerCount = 2020, -- Global storage for counting the players left/entered in the event
gobletsur = 10127, -- id del premio con nombre.
templeWait = {x = 8964, y = 8597, 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 = 8940, y = 8587, z = 7}, -- supongo k ya saben como es esto top left cornor of the playground
toPositions = {x = 8958, y = 8605, z = 7}, -- bottom right cornor of the playground
}
local Event_Start = 3032
function onStatsChange(cid, attacker, type, combat, value)
if combat == COMBAT_HEALING then
return true
end
if getCreatureHealth(cid) > value then
return true
end
if isInArea(getPlayerPosition(cid), config.fromPositions, config.toPositions) then
if isPlayer(cid) and isMonster(attacker) then
if getGlobalStorageValue(config.playerCount) >= 2 then
doBroadcastMessage(getPlayerName(cid) .. " Ah Muerto En The Surviving 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, 12811, - 1) --- reconoser players que entraron
doRemoveConditions(cid,false)
return true
end
if isInArea(getPlayerPosition(cid), config.fromPositions, config.toPositions) then
if isPlayer(cid) and isMonster(attacker) then
if getGlobalStorageValue(config.playerCount) == 1 then
doBroadcastMessage(getPlayerName(cid) .. " Gano The Surviving Event! Congratulations!", MESSAGE_STATUS_WARNING)
local gobletsur = doPlayerAddItem(cid, config.gobletsur, 1)
doItemSetAttribute(gobletsur, "description", "Premio Para " .. getPlayerName(cid) .. " Por Ganar The Surviving 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)
doPlayerAddItem(cid, 12372, 15)
doRemoveConditions(cid,false)
setPlayerStorageValue(cid, 12811, - 1) --- reconoser players que entraron
setGlobalStorageValue(Event_Start, 0)
setGlobalStorageValue(config.playerCount, 0)
return true
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
areapos = {x = x, y = y, z = z, stackpos = 253}
getMonsters = getThingfromPos(areapos)
if isMonster(getMonsters.uid) then
doRemoveCreature(getMonsters.uid)
end
end
end
end
end
return false
end
end
end
return true
end
local config = {
playerCount = 2020, -- Global storage for counting the players left/entered in the event
gobletsur = 10127, -- id del premio con nombre.
templeWait = {x = 8964, y = 8597, 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 = 8940, y = 8587, z = 7}, -- supongo k ya saben como es esto top left cornor of the playground
toPositions = {x = 8958, y = 8605, z = 7}, -- bottom right cornor of the playground
}
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 Surviving 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, 12811, - 1) --- reconoser players que entraron
doRemoveConditions(cid, false)
elseif getGlobalStorageValue(config.playerCount) == 1 then
doBroadcastMessage(getPlayerName(cid) .. " Gano The Surviving Event! Congratulations!", MESSAGE_STATUS_WARNING)
local gobletsur = doPlayerAddItem(cid, config.gobletsur, 1)
doItemSetAttribute(gobletsur, "description", "Premio Para " .. getPlayerName(cid) .. " Por Ganar The Surviving 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)
doPlayerAddItem(cid, 12372, 15)
doRemoveConditions(cid, false)
setPlayerStorageValue(cid, 12811, - 1) --- reconoser players que entraron
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
info
Grupo: Artesão
Registrado: 10/11/11
Posts: 118
Reputação: +2

irmão graças trabalhou muito bem. único problema ocorreu-me que, se eles morreram por outra jugadore ivan no nível 1, kkkk mas apenas pondre área non pvp no mapa xD! +rep
você poderia dizer que ele estava ficando ruim no meu script? xD para saber mais: D







info
Grupo: Artesão
Registrado: 10/11/11
Posts: 118
Reputação: +2
Jogadores na área frompos, topos, a morte, que se > = 2 global storage jogadores teleportado uma área e remover um globalstorage, e se globalStorage == 1 teleporte templo e entrega de prémio e remover monstros em area frompos, topos.
Editado Outubro 18 por beenii