[DiscordArchive] Guys i need a help with 1 script. I am trying to add a script for my new creature and the problem is
[DiscordArchive] Guys i need a help with 1 script. I am trying to add a script for my new creature and the problem is
Archived author: cyberpro98 • Posted: 2024-10-31T21:17:07.150000+00:00
Original source
Guys i need a help with 1 script. I am trying to add a script for my new creature and the problem is that when he flies up and cast all the spells he needs to cast, he just leaves the combat. Anyone to help ?
Archived author: cyberpro98 • Posted: 2024-10-31T21:20:45.790000+00:00
Original source
```js
local function StartAirPhase(eventId, delay, repeats, creature)
if not creature then return end
DebugPrint("Starting Air Phase")
isInAirPhase = true
creature:SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)
creature:SetHover(true)
creature:SetDisableGravity(true)
creature:MoveTo(POINT_TAKEOFF, creature:GetX(), creature:GetY(), creature:GetZ() + 17)
creature:SetReactState(0)
creature:RegisterEvent(function(eventId, delay, calls, creature)
if creature then
creature:MoveTo(POINT_AIR, -1142.373291, 31.250147, 723.480164)
CastSindragosasFury(nil, nil, nil, creature)
CastFrostBomb(nil, nil, nil, creature)
-- Maintain combat using AttackStart
local players = creature:GetPlayersInRange(100)
if #players > 0 then
creature:AttackStart(players[1])
end
creature:RegisterEvent(function(eventId, delay, calls, creature)
if creature then
creature:RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)
EndAirPhase(creature)
end
end, isThirdPhase and 15000 or 30000, 1)
end
end, 1000, 1)
end
```