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

Spell cast cooldown time on Boss Script

Status
Not open for further replies.

Xaver

Respected Member
"I wrote Kaev a PM to translate it, he will do it asap"



hallo ich habe folgendes problem und zwar habe ich mein boss script fertig und habe da spells eingefügt soweit alles super nur das problem ist:

das der boss die spells sowort castet also nach vorgegebener zeit natürlich aber ich möchte das der boss ne abkling zeit hat.

zb habe ich den spell: KataKlysmus

und der spell hat normal 1 min bis er gecastet wird, problem ist der boss castet den sofort

wie kann man das beheben ??

danke.

Code:
-- Copyright (C) 2013 - 2014 Fire of Destiny <http://fire-of-destiny.com/>
-- Scripted my Xaver aka Mojo


local BOSS = 700101


local function Kataklysm(eventId, dely, calls, creature) --donerknal
    creature:CastSpell(creature, 6343, true)
end


local function Dead(event, delay, pCall, creature, player, killed)
    if (creature:GetHealthPct() <= 0) then -- Wenn Boss ToT < 0% Letzter Text
		creature:SendUnitYell("Finish", 0)  --Boss Schreit Text
		creature:RemoveEvents()
 
	   end
end

local function Phase1(event, delay, pCall, creature, player, pMisc)
    if (creature:GetHealthPct() <= 80) then
        creature:RemoveEvents()
		creature:SendUnitYell("Cast Kataklysmus", 0)
		[COLOR="#00FF00"]creature:RegisterEvent(Kataklysm, 200, 1)  --- Kataclysm = Spell, 200 ms, 1 = one cats[/COLOR]
        creature:RegisterEvent(Dead, 1000, 0)
    end
end

local function Start(event, creature, target, player)
    creature:RegisterEvent(Phase1, 1000, 0)
	
end

RegisterCreatureEvent(BOSS, 1, Start)
 

Kaev

Super Moderator
Hello, i have the following problem: I finished my boss script and inserted spells.
I want that the boss casts the spell after a time which i can choose.
For example: Spell Cataclysm. Normally, they spell would be casted after 1 minute, but my boss casts it instant.
How can i fix that?

Code:
-- Copyright (C) 2013 - 2014 Fire of Destiny <http://fire-of-destiny.com/>
-- Scripted my Xaver aka Mojo


local BOSS = 700101


local function Kataklysm(eventId, dely, calls, creature) --donerknal
    creature:CastSpell(creature, 6343, true)
end


local function Dead(event, delay, pCall, creature, player, killed)
    if (creature:GetHealthPct() <= 0) then -- Wenn Boss ToT < 0% Letzter Text
		creature:SendUnitYell("Finish", 0)  --Boss Schreit Text
		creature:RemoveEvents()
 
	   end
end

local function Phase1(event, delay, pCall, creature, player, pMisc)
    if (creature:GetHealthPct() <= 80) then
        creature:RemoveEvents()
		creature:SendUnitYell("Cast Kataklysmus", 0)
		creature:RegisterEvent(Kataklysm, 200, 1)  --- Kataclysm = Spell, 200 ms, 1 = one cats
        creature:RegisterEvent(Dead, 1000, 0)
    end
end

local function Start(event, creature, target, player)
    creature:RegisterEvent(Phase1, 1000, 0)
	
end

RegisterCreatureEvent(BOSS, 1, Start)
 

Rochet2

Moderator / Eluna Dev
creature:RegisterEvent(Kataklysm, 200, 1) --- Kataclysm = Spell, 200 ms, 1 = one cast

The reason is that in this function call you have 200 ms as the timer.
That is 0.2 seconds, so it appears instant.
You should use 60*1000 to make the delay last one minute.
 

Grandelf

Esteemed Member
Just as a side note, you do not have to make a check whether the boss is still alive or not.
Code:
creature:RegisterEvent(Dead, 1000, 0)
There is an onDied event (just like the onCombat event) that will do that for you:
Code:
CREATURE_EVENT_ON_DIED                            = 4,  // (event, creature, killer)
So instead you could just do:
Code:
local function Dead(event, creature, killer)
	creature:SendUnitYell("Finish", 0)  --Boss Schreit Text
	creature:RemoveEvents()
end
RegisterCreatureEvent(BOSS, 4, Dead)
and remove the "creature:RegisterEvent(Dead, 1000, 0)".
 

Xaver

Respected Member
Das hilf mir nicht richtig, was ich will ist zb das hier :

Unbenannt.png

Dieser Spell wenn ich ihn Caste brauch eine Minute bis er Castet also aktiv ist.

das will ich auch beim Boss haben, der Boss Castet ihn direkt

und das: creature:RegisterEvent(Kataklysm, 200, 1) das die 200 ms die zeit ist wann er es Casten soll ist schon klar, es geht nur um den Spell

er soll ihn nicht sofort Casten wenn es an der zeit ist sondern der spell soll aufladen.
 
Last edited:
Status
Not open for further replies.
Top