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

Boss: help again please

Status
Not open for further replies.

Tommy

Founder
I edited the script before I tested. I added "creature:RemoveEvents()" to OnDied and OnLeaveCombat. Once I did that I tested it and he doesn't do what you say.

Code:
local npcId = 200000

function OnEnterCombat(event, creature, victim)
   creature:SendUnitYell("You are kidding... Right?", 0)
   creature:RegisterEvent(ShadowCleave, 10000, 0)
   creature:RegisterEvent(OnCheckHealth, 1000, 0)
end

function OnCheckHealth(event, delay, pCall, creature)
    if (creature:GetHealthPct() <= 75) then
        creature:RemoveEventById(event)
        creature:CastSpell(target, 40000)
		creature:RegisterEvent(OnCheckHealth1, 1000, 0)
    end
end

function ShadowCleave(event, delay, pCall, creature)
    creature:RemoveEventById(event)
	creature:CastSpell(creature:GetVictim(), 69492, true)
end

function OnCheckHealth1(event, delay, pCall, creature)
	local target = creature:GetAITarget(3, true)
    if (creature:GetHealthPct() <= 25) then
        creature:RemoveEventById(event)
        creature:CastSpell(target, 40000)
    end
end
 
function OnLeaveCombat(event, creature)
    creature:SendUnitYell("Bring a challenge next time!", 0)
	creature:CastSpell(creature, 23965, true)
	creature:RemoveEvents()
end

function OnTargetDied(event, creature, victim)
    creature:SendUnitYell("Seems like you are the weakest link!", 0)
end

function OnDied(event, creature, killer)
    creature:RemoveEvents()
    creature:SendUnitYell("This is just the... Beginning!", 0)
end

RegisterCreatureEvent(npcId, 1, OnEnterCombat)
RegisterCreatureEvent(npcId, 2, OnLeaveCombat)
RegisterCreatureEvent(npcId, 3, OnTargetDied)
RegisterCreatureEvent(npcId, 4, OnDied)
 

Lightning Blade

BETA Tester
Testing if it had something to do with the DB. will post an update if it was.

- - - Updated - - -

It seems like " creature:RemoveEvents() " had to be added before the " SendUnitYell " under " OnLeaveCombat "
 
Status
Not open for further replies.
Top