hudmap

02/15/2011 13:31 realdee#1
Das Addon ist auf dem Stand von 4.0.3a, ich habe selber versucht ein neues Instanz Modul [Bastion of Twilight] einzufügen, doch bekomme ich ingame keine Funktion.

Alte Funktion:

PHP Code:
local encounters = HudMap:GetModule("Encounters")
local HudMap = _G.HudMap
local UnitName
, UnitIsDead = _G.UnitName, _G.UnitIsDead
local parent 
= HudMap
local L 
= LibStub("AceLocale-3.0"):GetLocale("HudMap")
local SN = parent.SN

local 
function register(e)
    
encounters:RegisterEncounterMarker(e)
    return 
e
end

local free 
= parent.free

local vezax 
= {
    
name = L["General Vexaz"],
    
startEncounterIDs = 33271,
    
endEncounterIDs = 33271,
    
options = {
        
crash = SN[60835],
        
mark = SN[63276]
    },
    
defaults = {
        
crashColor = {r = 0.1, g = 0.4, b = 1, a = 0.6},
        
markColor = {r = 0.9, g = 0.4, b = 1, a = 0.6}
    },
    
crash = function(self)
        
local crashTarget = encounters:GetMobTarget(33271)
        if 
crashTarget then
            local x
, y = HudMap:GetUnitPosition(crashTarget)
            
local r, g, b, a = self:Option("crashColor")
            
register(HudMap:PlaceRangeMarker("timer", x, y, 10, 5, r, g, b, a):Appear():Rotate(360, 5):RegisterForAlerts())
        
end
    end
,
    
SPELL_CAST_SUCCESS = function(self, spellID, sourceName, destName, sourceGUID, destGUID)
        if (
spellID == 60835 or spellID == 62660) and self:Option("crashEnabled") then
            self
.invoker = self.invoker or function() self:crash() end
            encounters
:Delay(self.invoker, 0.1)
        elseif 
spellID == 63276 and self:Option("markEnabled") then
            local r
, g, b, a = self:Option("markColor")
            
register(HudMap:PlaceRangeMarkerOnPartyMember("timer", destName, 15, 10, r, g, b, a):Appear():Rotate(360, 10):RegisterForAlerts():SetLabel(destName))
        
end
    end
}


encounters:RegisterModule(L["Ulduar"], vezax) 
Dies würde ich nun auf Valiona Theralion 25hc anwenden.

Valiona: #45992 , [meteorit radius 3m: #92861]
Theralion: #45993, [druckwelle radius 5m: #86369]
[Datein ändern: HudMap.toc, enUs, deDE,

PHP Code:
local encounters = HudMap:GetModule("Encounters")
local HudMap = _G.HudMap
local UnitName
, UnitIsDead = _G.UnitName, _G.UnitIsDead
local parent 
= HudMap
local L 
= LibStub("AceLocale-3.0"):GetLocale("HudMap")
local SN = parent.SN

local 
function register(e)
    
encounters:RegisterEncounterMarker(e)
    return 
e
end

local free 
= parent.free



local valiona 
= {
    
name = L["Valiona Theralion"],
    
startEncounterIDs = 45992, 45993,
    
endEncounterIDs = 45992, 45993,
    
options = {
        
blast = SN[86369],
        
meteorit = SN[92861]
    },
    
defaults = {
        
blastColor = {r = 0.1, g = 0.4, b = 1, a = 0.6},
            
meteoritColor = {r = 0.1, g = 0.4, b = 1, a = 0.6},
    },
    
blast = function(self)
        
local blastTarget = encounters:GetMobTarget(45993)
        if 
blastTarget then
            local x
, y = HudMap:GetUnitPosition(blastTarget)
            
local r, g, b, a = self:Option("blastColor")
            
register(HudMap:PlaceRangeMarker("timer", x, y, 10, 5, r, g, b, a):Appear():Rotate(360, 5):RegisterForAlerts())
        
end
    end
,

    
SPELL_CAST_SUCCESS = function(self, spellID, sourceName, destName, sourceGUID, destGUID)
        if (
spellID == 86369) and self:Option("blastEnabled") then
            self
.invoker = self.invoker or function() self:blast() end
            encounters
:Delay(self.invoker, 0.1)
            
register(HudMap:PlaceRangeMarkerOnPartyMember("timer", destName, 15, 10, r, g, b, a):Appear():Rotate(360, 10):RegisterForAlerts():SetLabel(destName))
        
end
    end
,



    
meteorit = function(self)
        
local meteoritTarget = encounters:GetMobTarget(45992)
        if 
blastTarget then
            local x
, y = HudMap:GetUnitPosition(meteoritTarget)
            
local r, g, b, a = self:Option("meteoritColor")
            
register(HudMap:PlaceRangeMarker("timer", x, y, 6, 3, r, g, b, a):Appear():Rotate(360, 5):RegisterForAlerts())
        
end
    end
,

    
SPELL_CAST_SUCCESS = function(self, spellID, sourceName, destName, sourceGUID, destGUID)
        if (
spellID == 92861) and self:Option("meteoritEnabled") then
            self
.invoker = self.invoker or function() self:meteorit() end
            encounters
:Delay(self.invoker, 0.1)
            
register(HudMap:PlaceRangeMarkerOnPartyMember("timer", destName, 15, 10, r, g, b, a):Appear():Rotate(360, 10):RegisterForAlerts():SetLabel(destName))
        
end
    end
}


encounters:RegisterModule(L["Bastion of Twilight"], valiona) 
Nur bekomme ich keine Funktion... wenn jemand die Lösung hat bitte melden