[Lua Help] Algalon the Observer menu

User Tag List

Results 1 to 5 of 5
  1. #1
    Daskin's Avatar Member
    Reputation
    1
    Join Date
    Jul 2009
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua Help] Algalon the Observer

    Hey, having some problems with my Algalon script.
    Problem one: Killing the Living Constallations on moving over the Black holes. It was originally working untill I noticed all Blackholes and Constallations would despawn when moving over one.
    Im positive i've tried to fix this in a over-complicated way but my mind has blanked.
    Problem two: the Collapsing stars dont lose HP.

    Btw, trying to make this as Blizzlike as possible, so if theres anything in there that isnt Blizzlike post it please .
    Lua pastebin - collaborative debugging tool

    Code:
    --[[
    
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    **		ALGALON THE OBSERVER		**
    **		SCRIPTED BY DASKIN			**
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    ]]
    
    print "Algalon the Observer loaded."
    
    
    -- VARIABLE REGISTER --
    
    local Alg
    local BlackH
    local LivConst
    local DarkMatt
    local CollapS
    local Phase2
    local phase = 0
    local bigbangcast = 0
    local CollapStars = {}
    local starsdead = 0
    
    -- Spells --
    
    local QuantStrike = 64395
    local PhasePunch = 64412
    local CosSmash = 62311
    local BigBang = 64443
    local Ascend = 64487
    local BlackExplo = 64122
    local ArcBarrage = 64599
    
    
    --########--
    
    function table.find(t, v)
        if type(t) == "table" and v then
            for k, val in pairs(t) do
                if v == val then
                    return k
                end
            end
        end
        return false
    end
    
    
    -- Collapsing Star HP --
    
    
    function Algalon_OnSpawn (pUnit, Event)
    Alg = pUnit
    UNIT_FLAG_DEFAULT = Alg:GetUInt64Value(UNIT_FIELD_FLAGS)
    end
    
    function BlackH_OnSpawn (pUnit, Event)
    print "blackH spawned"
    BlackH = pUnit
    BlackH:GetUInt64Value(UNIT_FIELD_FLAGS)
    BlackH:RegisterEvent("BlackH_OnUse", 1, 0)
    end
    
    function StarsColl_OnSpawn (pUnit, Event)
    CollapS = pUnit
    CollHp = 100
    --CollapS:GetGuid() = CollapS1
    bx = CollapS:GetSpawnX()
    by = CollapS:GetSpawnY()
    bz = CollapS:GetSpawnZ()
    bo = CollapS:GetSpawnO()
    CollapS:SetCombatCapable(1)
    CollapS:SetCombatMeleeCapable(1)
    CollapS:RegisterEvent("CollapsingStar_HpLose", 500, 0)
    CollapS:RegisterEvent("CollapsingStar_On100", 1, 0)
    end
    
    --[[function CollHp.lower (self, v)
    self.CollHp = CollapS.CollHp - v
    end]]
    
    function CollapsingStar_HpLose (pUnit, Event)
    	if (CollHP ~= 0 and stardead == 0) then
    		for k, v in pairs (CollapStars) do
    			if (k == 1) then
    			CollHp = CollHp - 1
    				for i = 1, #CollapStars do
    				v:SetHealthPct(CollHP)
    				end
    			end
    			if (k == 2) then
    			CollHp = CollHp - 1
    				for i = 2, #CollapStars do
    				v:SetHealthPct(CollHP)
    				end
    			end
    			if (k == 3) then
    			CollHp = CollHp - 1
    				for i = 3, #CollapStars do
    				v:SetHealthPct(CollHP)
    				end
    			end
    		end
    	end
    end
    
    function CollapsingStar_On100 (pUnit, Event)
    	if (CollHp == 0) then
    	CollapS:CastSpell(BlackExplo)
    	CollapS:Kill(CollapS)
    	end
    end
    
    function CollapsingStar_OnDeath (pUnit, Event)
    starsdead = starsdead + 1
    	if (starsdead == 1) and (starsspawned == 1) then
    	BlackHSpawn[1] = CollapS:SpawnCreature(32953, bx, by, bz, bo, 35, 0)
    	CollapStars[1]:Despawn(0, 0)
    		elseif (starsdead == 2) and (starsspawned == 2) then
    	BlackHSpawn[2] = CollapS:SpawnCreature(32953, bx, by, bz, bo, 35, 0)
    	CollapStars[2]:Despawn(0, 0)
    		elseif (starsdead == 3) then
    	BlackHSpawn[3] = CollapS:SpawnCreature(32953, bx, by, bz, bo, 35, 0)
    	CollapStars[3]:Despawn(0, 0)
    	end
    blackholespawned = 1
    print "blackholespawn?"
    CollapS:RemoveEvents()
    CollapS:Despawn(0,0)
    end
    
    function Phase2_OnSpawn (pUnit, Event)
    Phase2 = pUnit
    Phase2:AddPhase(2, 1)
    Phase2:SetPhase(2, 1)
    Phase2:SetUint64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)
    end
    
    
    function LivingConst_OnSpawn (pUnit, Event)
    LivConst = pUnit
    end
    
    function DarkMatt_OnSpawn (pUnit, Event)
    Darkmatt = pUnit
    Darkmatt:SetPhase(2, 1)
    end
    
    function BlackH_OnUse (pUnit, Event)
    local plr = BlackH:GetClosestPlayer()
    	if plr:GetPhase() == 1 and (bigbangcast == 1) then	
    		if plr:GetDistance() <= 5 then
    		plr:AddPhase(2, 1)
    		plr:SetPhase(2, 1)
    		end
    	end
    end
    
    function Alg_CosSmash (pUnit, Event) -- WRONG VISUAL. NONE WORK.
    local plrcos = Alg:GetRandomPlayer(0)
    xcos = plrcos:GetX()
    ycos = plrcos:GetY()
    zcos = plrcos:GetZ()
    	if (plrcos ~= Alg:GetMainTank()) and (plrcos ~= nil) then
    	Alg:FullCastSpellOnTarget(62263, plrcos)
    	Alg:RegisterEvent("Alg_CosSmashDmg", 5000, 1)
    	end
    end
    
    function Alg_CosSmashDmg (pUnit, Event) -- Cant find any working Cosmic Smash spells.
    Alg:CastAoF(xcos, ycos, zcos, CosSmash) -- I'll leave this in if you can find a working spell.
    end
    
    function Alg_QuantStrike (pUnit, Event)
    local plr = Alg:GetMainTank()
    	if (plr ~= nil) then
    	Alg:FullCastSpellOnTarget(QuantStrike, plr)
    	end
    end
    
    function Alg_PhasePunch (pUnit, Event)
    local plr = Alg:GetMainTank()
    	if (plr ~= nil) then
    	Alg:FullCastSpellOnTarget(PhasePunch, plr)
    	end
    end
    
    function Alg_BigBang (pUnit, Event)
    	if (bigbangcast == 0) then
    	local chancesay = math.random(1, 2)
    		if (chancesay == 1) then
    		Alg:SendChatMessage(14, 0, "Witness the fury of cosmos!")
    			else
    		Alg:SendChatMessage(14, 0, "Behold the tools of creation!")
    		end
    	Alg:SendAreaTriggerMessage("Algalon begins to cast Big Bang!")
    	Alg:FullCastSpell(BigBang)
    	bigbangcast = 1
    	Alg:RegisterEvent("Alg_BigBangCasted", 8000, 1)
    	end
    end
    
    function Alg_BigBangCasted (pUnit, Event)
    	if (bigbangcast == 1) then
    	bigbangcast = 0
    		for k, v in pairs (Phase2:GetInRangePlayers()) do
    			if v:GetPhase() == 2 then
    			v:SetPhase(1, 1)
    			end
    		end
    	end
    end
    
    function Alg_Ascend (pUnit, Event)
    local plrs = Alg:GetInRangePlayers()
    	for k, v in pairs (plrs) do
    		if Alg:GetInRangePlayersCount() == 0 or (ZerkTimer == 360) then
    		Alg:PlaySoundToSet(15394)
    		Alg:SendChatMessage(14, 0, "You are... out of time.")
    		algberserked = 1
    		Alg:FullCastSpell(Ascend)
    		Alg:SendAreaTriggerMessage("Algalon has enraged!")
    		end
    	end
    end
    
    function Alg_AscendMin (pUnit, Event)
    Alg:PlaySoundToSet(15394)
    Alg:SendChatMessage(14, 0, "You are... out of time.")
    algberserked = 1
    Alg:FullCastSpell(Ascend)
    Alg:SendAreaTriggerMessage("Algalon has enraged!")
    end
    
    function Alg_ConstChecks (pUnit, Event)
    	if (blackholespawned == 1) then
    	local x = BlackH:GetX()
    	local y = BlackH:GetY()
    	local z = BlackH:GetZ()
    		--for k, v in pairs (BlackH:GetInRangeFriends()) do
    		local closeststar = BlackH:GetCreatureNearestCoords(x, y, z, 33052)
    			if closeststar:GetEntry() == 33052 and closeststar:GetDistance() <= 3 then
    			local closestar = closeststar:GetRawGUID()
    			local closestardespawn = closestar:GetUnitByRawGUID(closestar)
    			local x = closestar:GetX()
    			local y = closestar:GetY()
    			local z = closestar:GetZ()
    			local blackHclose = closeststar:GetCreatureNearestCoords(x, y, z, 32953)
    				if (blackHclose:GetEntry() == 32953) and (closestar:GetDistance() <= 3) then
    				local blackHdespawn = blackHclose:GetRawGUID()
    				local blackHdespawnn = blackHclose:GetUnitByRawGUID(blackHdespawn)
    				blackHdespawnn(0, 0)
    				closestardespawn:Despawn(0, 0)
    				end
    			end
    		--end
    	Alg:RegisterEvent("Phase2_CheckPlrs", 2000, 0)
    	end
    end
    
    --[[function Alg_ConstChecks (pUnit, Event)
    	 if (starsdead == 1) then
    	 BlackHSpawn[1]..
    	 ..
    	 ..
    	 wtf.
    	 
    	 end
    	 end
    ]]
    
    function Alg_ZerkTimer (pUnit, Event) -- 360 seconds == 6min
    	if (algengaged == 1) and (algberserked == 0) then
    	ZerkTimer = ZerkTimer + 1
    	end
    end
    	
    	
    local starsspawned = 0
    	
    --[[	for k, v in pairs (LivConst)
    	v:GetRawGUID()
    		if (v:GetX() == blackholex) and (v:GetY() == blackholey) and (v:GetZ() == blackholez) then
    		v:GetUnitByGuid(]]
    
    function Alg_CollapSpawn (pUnit, Event)
    Alg:SendChatMessage(14, 0, "The stars come to my aid.")
    Alg:PlaySoundToSet(15392)
    local ranx = math.random(1, 15)
    local rany = math.random(5, 20)
    local x = Alg:GetX() + ranx
    local y = Alg:GetY() - rany
    local z = Alg:GetZ()
    local o = Alg:GetO()
    local starsspawned = starsspawned + 1
    	if (starsspawned == 1) then
    	CollapStars[1] = Alg:SpawnCreature(32955, x, y, z, o, 14, 0)
    		elseif (starsspawned == 2) then
    	CollapStars[2] = Alg:SpawnCreature(32955, x, y, z, o, 14, 0)
    		elseif (starssapwned == 3) then
    	CollapStars[3] = Alg:SpawnCreature(32955, x, y, z, o, 14, 0)
    	elseif (starsspawned >= 4) then
    	starsspawned = 0
    	table.remove(t, 1)
    	table.remove(t, 2)
    	table.remove(t, 3)
    	end
    --[[Alg:SpawnCreature(32955, x, y, z, o, 14, 0)
    Alg:SpawnCreature(32955, x, y, z, o, 14, 0)
    Alg:SpawnCreature(32955, x, y, z, o, 14, 0)]]
    end
    
    function Alg_LivingConstSpawn (pUnit, Event)
    local ranx = math.random(1, 15)
    local rany = math.random(5, 20)
    local x = Alg:GetX() + ranx
    local y = Alg:GetY() - rany
    local z = Alg:GetZ()
    local o = Alg:GetO()
    Alg:SpawnCreature(33052, x, y, z, o, 14, 0)
    Alg:SpawnCreature(33052, x, y, z, o, 14, 0)
    Alg:SpawnCreature(33052, x, y, z, o, 14, 0)
    Alg:SpawnCreature(33052, x, y, z, o, 14, 0)
    end
    
    function LivingConst_OnCombat (pUnit, Event)
    local plr = LivConst:GetRandomPlayer(0)
    	if (plr ~= nil) then
    	LivConst:FullCastSpellOnTarget(ArcBarrage, plr)
    	end
    end
    
    function Phase2_SpawnMobs (pUnit, Event)
    	if (algengaged == 1) then
    	local ranx = math.random(1, 15)
    	local rany = math.random(5, 20)
    	local x = Phase2:GetX() + ranx
    	local y = Phase2:GetY() - rany
    	local z = Phase2:GetZ()
    	local o = Phase2:GetO()
    	Phase2:SpawnCreature(33089, x, y, z, o, 14, 0)
    	Phase2:SpawnCreature(33089, x, y, z, o, 14, 0)
    	Phase2:SpawnCreature(33089, x, y, z, o, 14, 0)
    	Phase2:SpawnCreature(33089, x, y, z, o, 14, 0)
    	Phase2:SpawnCreature(33089, x, y, z, o, 14, 0)
    	Phase2:SpawnCreature(33089, x, y, z, o, 14, 0)
    	Phase2:SpawnCreature(33089, x, y, z, o, 14, 0)
    	Phase2:SpawnCreature(33089, x, y, z, o, 14, 0)
    	end
    end
    
    function Phase2_CheckPlrs (pUnit, Event)
    local plrs = Phase2:GetInRangePlayers()
    	for k, v in pairs (plrs) do
    		if (v:GetPhase() == 2) and (blackholecast == 1) then
    		v:CastSpell(62169)
    		end
    	end
    end
    
    
    function Alg_OnCombat (pUnit, Event) -- Here we go
    Alg:SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)
    --Alg:SetUInt64Vlaue(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_9)
    Alg:SetCombatCapable(1)
    Alg:SendChatMessage(14, 0, "Trans-location complete. Commencing planetary analysis of Azeroth.")
    algengaged = 1
    Alg:RegisterEvent("Alg_Speech2", 6000, 1)
    end
    
    function Alg_Speech2 (pUnit, Event)
    Alg:SendChatMessage(14, 0, "Stand back, mortals. I am not here to fight you.")
    Alg:RegisterEvent("Alg_Speech3", 7000, 1)
    end
    
    function Alg_Speech3 (pUnit, Event)
    Alg:SendChatMessage(14, 0, "It is in the universe's best interest to re-originate this planet should my analysis find systemic corruption. Do not interfere.")
    Alg:RegisterEvent("Alg_CombatStart", 8000, 1)
    end
    
    function Alg_CombatStart (pUnit, Event)
    zerkcheck = Alg
    Alg:SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_DEFAULT)
    Alg:SetCombatCapable(0)
    Alg:PlaySoundToSet(15386)
    Alg:SendChatMessage(14, 0, "Your actions are illogical. All possible results for this encounter have been calculated. The Pantheon will receive the Observer's message regardless of outcome.")
    --Alg:SendChatMessage(14, 0, "See your world through my eyes: A universe so vast as to be immeasurable - incomprehensible even to your greatest minds.") 
    Alg:RegisterEvent("Alg_PhasePunch", 15000, 0) -- Cant find the Star thingy animation.
    Alg:RegisterEvent("Alg_CosSmash", 25000, 0)
    Alg:RegisterEvent("Alg_BigBang", 90000, 0)
    Alg:RegisterEvent("Alg_QuantStrike", math.random(7000, 11000), 0)
    Alg:RegisterEvent("Alg_CollapSpawn", 19000, 0)
    Alg:RegisterEvent("Alg_LivingConstSpawn", 50000, 0)
    Alg:RegisterEvent("Alg_ConstChecks", 1, 0)
    Alg:RegisterEvent("Alg_ZerkTimer", 1000, 0) -- TESTING.
    Alg:RegisterEvent("Alg_Ascend", 1, 0)
    Alg:RegisterEvent("Alg_Phase2", 1, 0)
    zerkcheck:RegisterEvent("Alg_AscendMin", 360000, 1)
    end
    
    function Alg_Phase2 (pUnit, Event)
    if Alg:GetHealthPct() <= 20 then
    --
    Alg:RemoveEvents()
    BlackH:Despawn(0, 0)
    BlackH:RemoveEvents()
    LivConst:Despawn(0, 0)
    LivConst:RemoveEvents()
    CollapS:Despawn(0, 0)
    CollapS:RemoveEvents()
    --
    Alg:SendChatMessage(14, 0, "Beware!")
    Alg:RegisterEvent("Alg_PhasePunch", 15000, 0)
    Alg:RegisterEvent("Alg_QuantStrike", math.random(7000, 11000), 0)
    Alg:RegisterEvent("Alg_CosSmash", 25000, 0)
    Alg:RegisterEvent("Alg2_BlackHoleSpawn", 2000, 1)
    Alg:RegisterEvent("Alg2_DarkMattSpawn", 30000, 0)
    Alg:RegisterEvent("Alg_Defeat", 1, 0)
    end
    end
    
    function Alg2_BlackHoleSpawn (pUnit, Event)
    local x = Alg:GetX() + 5
    local y = Alg:GetY() + 5
    local z = Alg:GetZ()
    local o = Alg:GetO()
    local x2 = Alg:GetX() + 5
    local y2 = Alg:GetY() - 5
    local z2 = Alg:GetZ()
    local o2 = Alg:GetO()
    local x3 = Alg:GetX() - 5
    local y3 = Alg:GetY() + 5
    local z3 = Alg:GetZ()
    local o3 = Alg:GetO()
    local x4 = Alg:GetX() - 5
    local y4 = Alg:GetY() - 5
    local z4 = Alg:GetZ()
    local o4 = Alg:GetO()
    Alg:SpawnCreature(32953, x, y, z, o, 42, 0)
    Alg:SpawnCreature(32953, x2, y2, z2, o2, 42, 0)
    Alg:SpawnCreature(32953, x3, y3, z3, o3, 42, 0)
    Alg:SpawnCreature(32953, x4, y4, z4, o4, 42, 0)
    end
    
    function Alg2_DarkMattSpawn (pUnit, Event)
    local x = Alg:GetX() + 5
    local y = Alg:GetY() + 5
    local z = Alg:GetZ()
    local o = Alg:GetO()
    local x2 = Alg:GetX() + 5
    local y2 = Alg:GetY() - 5
    local z2 = Alg:GetZ()
    local o2 = Alg:GetO()
    local x3 = Alg:GetX() - 5
    local y3 = Alg:GetY() + 5
    local z3 = Alg:GetZ()
    local o3 = Alg:GetO()
    local x4 = Alg:GetX() - 5
    local y4 = Alg:GetY() - 5
    local z4 = Alg:GetZ()
    local o4 = Alg:GetO()
    Alg:SpawnCreature(33089, x, y, z, o, 42, 0)
    Alg:SpawnCreature(33089, x2, y2, z2, o2, 42, 0)
    Alg:SpawnCreature(33089, x3, y3, z3, o3, 42, 0)
    Alg:SpawnCreature(33089, x4, y4, z4, o4, 42, 0)
    end
    
    function Alg_Defeat (pUnit, Event)
    	if Alg:GetHealthPct() <= 2 then
    	Alg:RemoveEvents()
    	BlackH:Despawn(0, 0)
    	BlackH:RemoveEvents()
    	LivConst:Despawn(0, 0)
    	LivConst:RemoveEvents()
    	CollapS:Despawn(0, 0)
    	CollapS:RemoveEvents()
    	Alg:SetHealthPct(100)
    	Alg:SetFaction(42)
    	Alg:PlaySoundToSet(15393)
    	Alg:SendChatMessage(12, 0, "I have seen worlds bathed in the Makers' flames. Their denizens fading without so much as a whimper. Entire planetary systems born and raised in the time that it takes your mortal hearts to beat once. Yet all throughout, my own heart, devoid of emotion... of empathy. I... have... felt... NOTHING! A million, million lives wasted. Had they all held within them your tenacity? Had they all loved life as you do?")
    	Alg:RegisterEvent("Alg_DefeatSpeech", 6000, 1)
    	end
    end
    
    function Alg_DefeatSpeech (pUnit, Event)
    Alg:PlaySoundToSet(15401)
    Alg:SendChatMessage(12, 0, "Perhaps it is your imperfection that which grants you free will. That allows you to persevere against cosmically calculated odds. You prevailed where the Titans' own perfect creations have failed.")
    Alg:RegisterEvent("Alg_DefeatSpeech2", 5000, 1)
    end
    
    function Alg_DefeatSpeech2 (pUnit, Event)
    Alg:PlaySoundToSet(15402)
    Alg:SendChatMessage(12, 0, "I've rearranged the reply code. Your planet will be spared. I cannot be certain of my own calculations anymore.")
    Alg:RegisterEvent("Alg_DefeatSpeech3", 3000, 1)
    end
    
    function Alg_DefeatSpeech3 (pUnit, Event)
    Alg:SendChatMessage(12, 0, "I lack the strength to transmit the signal. You must hurry. Find a place of power close to the skies.")
    Alg:RegisterEvent("Alg_DefeatSpeech4", 4000, 1)
    end
    
    function Alg_DefeatSpeech4 (pUnit, Event)
    local plr = Alg:GetRandomPlayer()
    local name = plr:GetName()
    Alg:SendChatMessage(14, 0, "Do not worry about my fate"..name..". If the signal is not transmitted in time re-origination will proceed regardless. Save. Your. World.")
    Alg:RegisterEvent("Alg_Loot", 2000, 1)
    end
    
    function Alg_KilledPlr (pUnit, Event)
    local chance = math.random(1,2)
    	if (chance == 1) then
    	Alg:PlaySoundToSet(15387)
    	Alg:SendChatMessage(14, 0, "Loss of life, unavoidable.")
    		else
    	Alg:PlaySoundToSet(15388)
    	Alg:SendChatMessage(14, 0, "I do what I must..")
    	
    	end
    end
    
    function Alg_OnDeath (pUnit, Event) -- Shouldnt happen
    Alg:RemoveEvents()
    BlackH:Despawn(0, 0)
    BlackH:RemoveEvents()
    LivConst:Despawn(0, 0)
    LivConst:RemoveEvents()
    CollapS:Despawn(0, 0)
    CollapS:RemoveEvents()
    phase = 0
    bigbang = 0
    end
    
    function Alg_OnLeaveCombat (pUnit, Event)
    phase = 0
    bigbang = 0
    Alg:RemoveEvents()
    BlackH:Despawn(0, 0)
    BlackH:RemoveEvents()
    LivConst:Despawn(0, 0)
    LivConst:RemoveEvents()
    CollapS:Despawn(0, 0)
    CollapS:RemoveEvents()
    Alg:SendChatMessage(12, 0, "Analysis complete. There is partial corruption in the planet's life-support systems as well as complete corruption in most of the planet's defense mechanisms.")
    Alg:RegisterEvent("Alg_LeaveCombat2", 5000, 1)
    end
    
    function Alg_LeaveCombat2 (pUnit, Event)
    Alg:SendChatMessage(14, 0, "Begin uplink: Reply Code: 'Omega'. Planetary re-origination requested.")
    Alg:RegisterEvent("Alg_LeaveCombat3", 4000, 1)
    end
    
    function Alg_LeaveCombat3 (pUnit, Event)
    Alg:SendChatMessage(14, 0, "Farewell, mortals. Your bravery is admirable, for such flawed creatures.")
    Alg:Despawn(0, 120000)
    end
    
    -- RegisterUnitEvents /cry --
    -- IF ONSPAWN ISNT WORKING, USE 6 INSTEAD OF 18 --
    
    RegisterUnitEvent(32953, 18, "BlackH_OnSpawn")
    RegisterUnitEvent(32955, 4, "CollapsingStar_OnDeath")
    RegisterUnitEvent(32871, 1, "Alg_OnCombat")
    RegisterUnitEvent(33052, 1, "LivingConst_OnCombat")
    --RegisterUnitEvent(entryid, 1, "_OnCombat")
    --RegisterUnitEvent(entryid, 1, "_OnCombat")
    RegisterUnitEvent(32871, 18, "Algalon_OnSpawn")
    RegisterUnitEvent(33052, 18, "LivingConst_OnSpawn")
    RegisterUnitEvent(33089, 18, "DarkMatt_OnSpawn")
    RegisterUnitEvent(32955, 18, "StarsColl_OnSpawn")
    RegisterUnitEvent(500033, 18, "Phase2_OnSpawn")
    RegisterUnitEvent(32871, 2, "Alg_OnLeaveCombat")
    RegisterUnitEvent(32871, 3, "Alg_KilledPlr")
    RegisterUnitEvent(32871, 4, "Alg_OnDeath")

    [Lua Help] Algalon the Observer
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Well to be honest, the only work around that I can think of for not making all the blackholes and constallations despawn when moving over would be to make them all seperate id's. Just make however many depending on how many need to be spawned at a time, and set them as variables.
    For the collapsing stars, I don't know the fight so I do not know what you are trying to do.

  3. #3
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function CollapsingStar_HpLose (pUnit, Event)
    	local currentHp = pUnit::GetHealth()
            if ( pUnit ~= nil and pUnit::IsAlive() ) then
                      pUnit::SetHealth( currentHp - ( currentHp / 100 ) )
    end
    there as for holes 2 lazy to read code

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

  4. #4
    Daskin's Avatar Member
    Reputation
    1
    Join Date
    Jul 2009
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Formula worked fine before I added the extra's to try and stop it only removing the HP on the one that spawned first, then stopping on the 2nd ones spawn.

  5. #5
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wierd, register it on spawn and dont track number of stars, that might bugg it, same goes for Black Holes!

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

Similar Threads

  1. Lua Help, Algalon script
    By Razmus94 in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 01-15-2010, 09:29 AM
  2. [Model Swap] Tauren Moonkin>Algalon The Observer
    By Sean3491 in forum World of Warcraft Model Editing
    Replies: 10
    Last Post: 07-18-2009, 07:53 AM
  3. [Study Guide] Algalon the Observer
    By gezus in forum World of Warcraft Guides
    Replies: 19
    Last Post: 07-10-2009, 07:49 PM
  4. [Request] All races/more to Algalon the Observer
    By Katsin Bloodoath in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 06-22-2009, 01:44 PM
  5. [Ulduar] Algalon the Observer
    By gerathros in forum World of Warcraft Guides
    Replies: 3
    Last Post: 03-21-2009, 03:36 AM
All times are GMT -5. The time now is 11:25 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search