PHP код:
mod:AddBoolOption("YellCountdown", true, "announce")
if args:IsSpellID(12345) then
if args:IsPlayer() and self.Options.YellCountdown then
self:ScheduleMethod(1, "ToTremor3")
self:ScheduleMethod(2, "ToTremor2")
self:ScheduleMethod(3, "ToTremor1")
end
end
function mod:ToTremor3()
SendChatMessage(L.YellTri, "SAY")
end
function mod:ToTremor2()
SendChatMessage(L.YellTwo, "SAY")
end
function mod:ToTremor1()
SendChatMessage(L.YellOne, "SAY")
end
Ну и в локализацию добавить
PHP код:
do
local voidForm = GetSpellInfo(194249)
local yellPrototype = {}
local mt = { __index = yellPrototype }
local function newYell(self, yellType, spellId, yellText, optionDefault, optionName, chatType)
if not spellId and not yellText then
error("NewYell: you must provide either spellId or yellText", 2)
return
end
if type(spellId) == "string" and spellId:match("OptionVersion") then
print("newYell for: "..yellText.." is using OptionVersion hack. This is depricated")
return
end
local optionVersion
if type(optionName) == "number" then
optionVersion = optionName
optionName = nil
end
local displayText
if not yellText then
if type(spellId) == "string" and spellId:match("ej%d+") then
displayText = DBM_CORE_AUTO_YELL_ANNOUNCE_TEXT[yellType]:format(DBM:EJ_GetSectionInfo(string.sub(spellId, 3)) or DBM_CORE_UNKNOWN)
else
displayText = DBM_CORE_AUTO_YELL_ANNOUNCE_TEXT[yellType]:format(DBM:GetSpellInfo(spellId) or DBM_CORE_UNKNOWN)
end
end
--Passed spellid as yellText.
--Auto localize spelltext using yellText instead
if yellText and type(yellText) == "number" then
displayText = DBM_CORE_AUTO_YELL_ANNOUNCE_TEXT[yellType]:format(DBM:GetSpellInfo(yellText) or DBM_CORE_UNKNOWN)
end
local obj = setmetatable(
{
text = displayText or yellText,
mod = self,
chatType = chatType,
yellType = yellType
},
mt
)
if optionName then
obj.option = optionName
self:AddBoolOption(obj.option, optionDefault, "yell")
elseif not (optionName == false) then
obj.option = "Yell"..(spellId or yellText)..(yellType ~= "yell" and yellType or "")..(optionVersion or "")
self:AddBoolOption(obj.option, optionDefault, "yell")
self.localization.options[obj.option] = DBM_CORE_AUTO_YELL_OPTION_TEXT[yellType]:format(spellId)
end
return obj
end
function yellPrototype:Yell(...)
if not IsInInstance() then--as of 8.2.5, forbidden in outdoor world
DBM:Debug("WARNING: A mod is still trying to call chat SAY/YELL messages outdoors, FIXME")
return
end
if DBM.Options.DontSendYells or self.yellType and self.yellType == "position" and DBM:UnitBuff("player", voidForm) and DBM.Options.FilterVoidFormSay then return end
if not self.option or self.mod.Options[self.option] then
if self.yellType == "combo" then
SendChatMessage(pformat(self.text, ...), self.chatType or "YELL")
else
SendChatMessage(pformat(self.text, ...), self.chatType or "SAY")
end
end
end
yellPrototype.Show = yellPrototype.Yell
--Force override to use say message, even when object defines "YELL"
function yellPrototype:Say(...)
if not IsInInstance() then --as of 8.2.5, forbidden in outdoor world
DBM:Debug("WARNING: A mod is still trying to call chat SAY/YELL messages outdoors, FIXME")
return
end
if DBM.Options.DontSendYells or self.yellType and self.yellType == "position" and DBM:UnitBuff("player", voidForm) and DBM.Options.FilterVoidFormSay then return end
if not self.option or self.mod.Options[self.option] then
SendChatMessage(pformat(self.text, ...), "SAY")
end
end
function yellPrototype:Schedule(t, ...)
return schedule(t, self.Yell, self.mod, self, ...)
end
function yellPrototype:Countdown(time, numAnnounces, ...)
if time > 60 then --[spellID not a time]--
local _, _, _, _, _, expireTime = DBM:UnitDebuff("player", time)
if expireTime then
local remaining = expireTime-GetTime()
scheduleCountdown(remaining, numAnnounces, self.Yell, self.mod, self, ...)
end
else
scheduleCountdown(time, numAnnounces, self.Yell, self.mod, self, ...)
end
end
function yellPrototype:Cancel(...)
return unschedule(self.Yell, self.mod, self, ...)
end
function bossModPrototype:NewYell(...)
return newYell(self, "yell", ...)
end
function bossModPrototype:NewShortYell(...)
return newYell(self, "shortyell", ...)
end
function bossModPrototype:NewCountYell(...)
return newYell(self, "count", ...)
end
function bossModPrototype:NewFadesYell(...)
return newYell(self, "fade", ...)
end
function bossModPrototype:NewShortFadesYell(...)
return newYell(self, "shortfade", ...)
end
function bossModPrototype:NewIconFadesYell(...)
return newYell(self, "iconfade", ...)
end
function bossModPrototype:NewPosYell(...)
return newYell(self, "position", ...)
end
function bossModPrototype:NewComboYell(...)
return newYell(self, "combo", ...)
end
end
Мб это как-то поможет, для тех, кто разбирается и можешь аддаптировать данный код под ДБМ 3.3.5а