• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

TrinityCore WotLK Summon Ohter Crerature On...

jonmii

Enthusiast
Hi,

I was trying to do a script wich summons a other creature when life is less than 25 seconds, and doesnt have DoT Damage.
I improved only to the part of less than 25%hp left but i dont know how to proceed with DoT damage calc.



Code:
local NPC_ID = 123



local valor = 0



local function InvocarGranTiniebla (eventID, delay, pCall, creature, target)
		
		
		
		while(valor == 0 ) do
		
		local x, y, z = creature:GetRelativePoint(math.random()*5, math.random()*math.pi*2)
		creature:SpawnCreature(870759, x, y, z, 0, 7)
valor = valor + 1
	end	
end


local function CheckHealth (eventID, delay, pCall, creature, target)
	if creature:GetHealthPct() <= 25 then
		local target = creature:GetAITarget(0, true)
		target:SendAreaTriggerMessage("Menos de 25%HP!")
		
		
	creature:RegisterEvent(InvocarGranTiniebla, 100, 0)

		
		
	end
end



local function KetLot_OnCombat (event, creature, target)
	local target = creature:GetAITarget(0, true)
	creature:AttackStop()
	creature:RegisterEvent(CheckHealth, 100, 0)

end

local function KetLot_Died (event, creature, target)


	creature:RemoveEvents()
end

local function KetLot_OnLeaveCombat (event, creature, target)
	creature:RemoveEvents()
end

local function KetLot_Spawn (event, creature, target)
	creature:MoveHome()
	creature:SetWalk(true)
end

RegisterCreatureEvent(NPC_ID, 1, KetLot_OnCombat)
RegisterCreatureEvent(NPC_ID, 24, KetLot_OnLeaveCombat)
RegisterCreatureEvent(NPC_ID, 5, KetLot_Spawn)
RegisterCreatureEvent(NPC_ID, 4, KetLot_Died)
THIS CODE IS BUGGY, IT ONLY SPAWNS FIRST TIME AFTER SERVER RESTART
 
Last edited:

jonmii

Enthusiast
So using that i have to store all spellsids manually on code.
My intention was to get any DoT duration, globally.

Thanks anyway
 

slp13at420

Mad Scientist
just the ids of spells with Dot I think .. at first ponder yea that is the only way to . I haven't seen an Eluna method like `Creature:GetAuras();` that would return a table of all current auras a player/char/npc has.
 
Last edited:
Top