Ir para conteúdo
  • 0

Script Para Evento Ajuda


Bennyhappy

Pergunta

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 por beenii
Link para o comentário
Compartilhar em outros sites

12 respostass a esta questão

Posts Recomendados

  • 0

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

Link para o comentário
Compartilhar em outros sites

  • 0

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

Link para o comentário
Compartilhar em outros sites

  • 0

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

Link para o comentário
Compartilhar em outros sites

  • 0

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

Link para o comentário
Compartilhar em outros sites

  • 0

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

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...