Ir para conteúdo

Featured Replies

Postado

TEM COMO ADAPTAR PRA TFS 0.4 ??? POR FAVOR PESSOAL DA UMA AJUDA AI SE TIVER

8.60


Gaz%27Haragoth.gif      HEAL - Se o life dele chega a 50k, ele solta um aviso, e depois de 5 segundos heala 300k.

Crie um arquivo em creaturescripts/scripts/ com o nome heal_gaz.lua e coloque esse código: 

-- <event type="healthchange" name="HealGaz" script="heal_gaz.lua"/>

local config = {
	life_ative = 50000,
	life_add = 300000,
	seconds_ative = 5,
	gStorage = 90702,
}

local function Uheal(cid)
	local gaz = Monster(cid)

	gaz:addHealth(config.life_add)
	gaz:say("Gaz'haragoth HEALS himself!", TALKTYPE_MONSTER_SAY)
	gaz:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
	Game.setStorageValue(config.gStorage, 0)
end

function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
	
	if attacker then
		if creature:getHealth() < config.life_ative and Game.getStorageValue(config.gStorage) < 1 then
			creature:say("Gaz'haragoth beginns to draw on the nightmares to HEAL himself!", TALKTYPE_MONSTER_SAY)
			addEvent(Uheal, 1000 * config.seconds_ative, creature.uid)
			Game.setStorageValue(config.gStorage, 1)
		end
	end

	return primaryDamage, primaryType, secondaryDamage, secondaryType
end 

A tag que deve add ao creaturescript.xml esta como comentário no script, é só add.

Depois para funcionar no Gaz, vá até o xml dele em monster e coloque em seu código: 

<script>
	<event name="HealGaz" />
</script>

Gaz%27Haragoth.gif      TELEPORT - Quem passa em cima do corpo dos summons do boss é teleportado para perto dele.

Crie um arquivo em movements/scripts/ com o nome tp_gaz.lua e coloque esse código: 

-- <movevent event="StepIn" itemid="22455" script="teleport_gaz.lua"/>

function onStepIn(creature, item, position, fromPosition)
	local player = creature:getPlayer()
	if player == nil then
		return false
	end

	local monster = Creature("Gaz'Haragoth")
	if monster then
		player:teleportTo(monster:getPosition())
	else
		player:teleportTo(fromPosition)
	end

	return true
end

Editado por ADM Mayk on BaiakME (veja o histórico de edições)

Resolvido por Wakon

Ir para solução
  • Respostas 26
  • Visualizações 3.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @ADM Mayk on BaiakME, testa assim: local config = { life_ative = 50000, life_add = 300000, seconds_ative = 5, gStorage = 90702, } function AddHealth(cid) setGlobalStorageValue

  • @ADM Mayk on BaiakME, na real não é pra criar um teleport e sim teleportar ao passar em cima do corpo, isso que o script que você pediu para adaptar faz. Colocou a tag no arquivo movements.xml co

  • @ADM Mayk on BaiakME, é assim que funciona, achei que você quisesse fazer algo diferente. Pra fazer parecido com o global, você pode configurar o strange vortex no items.xml para sumir após um te

Posted Images

Postado

@ADM Mayk on BaiakME 



local config = {
    life_ative = 50000,
    life_add = 300000,
    seconds_ative = 5,
    gStorage = 90702,
}

local function Uheal(cid)
    doCreatureAddHealth(cid, config.life_add)
    doCreatureSay(cid, "Gaz'haragoth HEALS himself!", TALKTYPE_MONSTER_SAY)
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
    doSetStorage(config.gStorage, 0)
end

function onStatsChange(cid, attacker, type, combat, value)
    
    if attacker and type == STATSCHANGE_HEALTHLOSS then
        if getCreatureHealth(cid) < config.life_ative and getStorage(config.gStorage) < 1 then
            doCreatureSay(cid, "Gaz'haragoth beginns to draw on the nightmares to HEAL himself!", TALKTYPE_MONSTER_SAY)
            addEvent(Uheal, 1000 * config.seconds_ative, cid)
            doSetStorage(config.gStorage, 1)
        end
    end
    return true
end
-- <movevent event="StepIn" itemid="22455" script="teleport_gaz.lua"/>

function onStepIn(cid, item, position, fromPosition)
    
    local player = cid
    if player == nil then
        return false
    end
    
    local monster = getCreatureByName("Gaz'Haragoth")
    local monster_pos = getCreaturePosition(monster)
    
    if monster then
        doTeleportThing(cid, monster_pos)
    else
        doTeleportThing(cid, fromPosition)
    end
    
    return true
end

 

Postado
  • Autor
2 horas atrás, Sttorm disse:

@ADM Mayk on BaiakME 




local config = {
    life_ative = 50000,
    life_add = 300000,
    seconds_ative = 5,
    gStorage = 90702,
}

local function Uheal(cid)
    doCreatureAddHealth(cid, config.life_add)
    doCreatureSay(cid, "Gaz'haragoth HEALS himself!", TALKTYPE_MONSTER_SAY)
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
    doSetStorage(config.gStorage, 0)
end

function onStatsChange(cid, attacker, type, combat, value)
    
    if attacker and type == STATSCHANGE_HEALTHLOSS then
        if getCreatureHealth(cid) < config.life_ative and getStorage(config.gStorage) < 1 then
            doCreatureSay(cid, "Gaz'haragoth beginns to draw on the nightmares to HEAL himself!", TALKTYPE_MONSTER_SAY)
            addEvent(Uheal, 1000 * config.seconds_ative, cid)
            doSetStorage(config.gStorage, 1)
        end
    end
    return true
end

-- <movevent event="StepIn" itemid="22455" script="teleport_gaz.lua"/>

function onStepIn(cid, item, position, fromPosition)
    
    local player = cid
    if player == nil then
        return false
    end
    
    local monster = getCreatureByName("Gaz'Haragoth")
    local monster_pos = getCreaturePosition(monster)
    
    if monster then
        doTeleportThing(cid, monster_pos)
    else
        doTeleportThing(cid, fromPosition)
    end
    
    return true
end

 

[Error - CreatureEvent::configureEvent] No valid type for creature event.healthchange
[13:59:36.390] [Warning - BaseEvents::loadFromXml] Cannot configure an event

Postado
38 minutos atrás, ADM Mayk on BaiakME disse:

[Error - CreatureEvent::configureEvent] No valid type for creature event.healthchange
[13:59:36.390] [Warning - BaseEvents::loadFromXml] Cannot configure an event

troca para statschange em creaturescripts.xml

Postado
  • Autor
44 minutos atrás, Lyu disse:

troca para statschange em creaturescripts.xml

[14:50:24.415] [Error - CreatureScript Interface]
[14:50:24.418] In a timer event called from:
[14:50:24.421] data/creaturescripts/scripts/heal_gaz.lua:onStatsChange
[14:50:24.426] Description:
[14:50:24.429] (LuaInterface::luaDoCreatureAddHealth) Creature not found

[14:50:24.435] [Error - CreatureScript Interface]
[14:50:24.439] In a timer event called from:
[14:50:24.442] data/creaturescripts/scripts/heal_gaz.lua:onStatsChange
[14:50:24.446] Description:
[14:50:24.448] (LuaInterface::luaDoCreatureSay) Creature not found

[14:50:24.452] [Error - CreatureScript Interface]
[14:50:24.456] In a timer event called from:
[14:50:24.459] data/creaturescripts/scripts/heal_gaz.lua:onStatsChange
[14:50:24.463] Description:
[14:50:24.466] (LuaInterface::luaGetThingPosition) Thing not found

 

 

agora da DEBUG quando a vida dele chega em x 

 

CONSEGUI ESSE AQUI NÃO DA ERRO NEM NADA !!!

 

    <event type="statschange" name="HealGaz" event="script" value="heal_gaz.lua"/>

Citar

local config = {
    life_ative = 50000,
    life_add = 300000,
    seconds_ative = 5,
    gStorage = 90702,
}

local function getCreatureHealth(cid)
    local gaz = isMonster(cid)

    doCreatureAddHealth(cid, config.life_add)
    doCreatureSay(cid, "Gaz'haragoth HEALS himself!", TALKTYPE_MONSTER_SAY)
    doSendMagicEffect(cid, CONST_ME_MAGIC_RED)
    getPlayerStorageValue(cid, config.gStorage, 0)
end

function onStatsChange(cid, creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    
    if isMonster(cid) and isPlayer(attacker) then
        if  isCreature(cid) < config.life_ative and getPlayerStorageValue(cid, config.gStorage) < 1 then
            doCreatureSay(cid, "Gaz'haragoth beginns to draw on the nightmares to HEAL himself!", TALKTYPE_MONSTER_SAY)
            addEvent(cid, Uheal, 1000 * config.seconds_ative, creature.uid)
            getPlayerStorageValue(cid, config.gStorage, 1)
        end
    end

    return primaryDamage, primaryType, secondaryDamage, secondaryType
end 

image.thumb.png.4afc6470363ccd604f379b6829cf5245.png

 

POREM NO JOGO FICA ASSIM A MAGIA DO HEAL SAI mais não cura o monstro ....

Editado por ADM Mayk on BaiakME (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo