Jump to content
Alloder.pro  about Allods with love 😱
Search In
  • More options...
Find results that contain...
Find results in...

Servers monitoring and the Addons Editor

We present you two legends. All dreams come true.

Servers monitoring The Addons Editor

Digest April

We talk about what was done and updated in the past month. We help keep abreast of events.

Read more

Game tooltips

Tooltips provide a way for 3rd party fansites and extensions to display detailed information on mouseover.

Read more

Руны


Guest adolf
 Share

Recommended Posts

Кто подскажет - как достать информацию о рунах?

Чет уже два дня мучаюсь ничего не получается.

Link to comment
Share on other sites

Даже не так=) не просто о рунах, а о рунах инспектируемого игрока. ну и своих тоже можно=) чет в апи я ничего что могло бы явно указывать на то как это сделать не нашел. устал, мозг взрывается=)

Link to comment
Share on other sites

  • 1 month later...
Guest adolf

function GetItemRuneLevel( itemId )

local runeLevel = 0

if itemId ~= nil then

local itemInfo = avatar.GetItemInfo( itemId ).runeInfo

if itemInfo.runeId ~= nil then

itemInfo.runeDescr = avatar.GetItemInfo( itemInfo.runeId ).runeInfo

--LogInfo( itemInfo.runeDescr.runeInfo.runeLevel )

runeLevel = itemInfo.runeDescr.runeInfo.runeLevel

end

end

return runeLevel

end

что я делаю не так?

Link to comment
Share on other sites

Страшный набор буков :)

Результат то какой? 0 всегда возвращается?

itemInfo.runeId - нет такого поля. И вообще чет насобирано всякого :)

Попробуй что нибудь типа (для Ру клиента):

Code:
function GetItemRuneLevel( itemId )

if itemId and avatar.GetItemInfo(itemId).runeInfo then

return avatar.GetItemInfo(itemId).runeInfo.runeLevel

end

return 0

end

Или что-нибудь навроде этого (для Евро-клиента, не проверял):

Code:
function GetItemRuneLevel( itemId )

if itemId then

if avatar.GetItemInfo(itemId).runeInfo then

return avatar.GetItemInfo(itemId).runeInfo.runeLevel

elseif avatar.GetItemInfo(itemId).runeId then

return GetItemRuneLevel(avatar.GetItemInfo(itemId).runeId)

end

end

return 0

end

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...
Code:
onEvent.EVENT_INSPECT_STARTED = function( pars )
local id = pars.id or avatar.GetInspectInfo().playerId
if id and object.IsExist(id) then
local name = FromWS( object.GetName(id) )
local uSts = { info = Inspect(id, unitStats [id] ) }
unitStats [ name ]  = uSts
uSts.timer = getPS("InspectStatsTimer") or 3
uSts.sts, uSts.rst, uSts.arm, uSts.stsSum, uSts.rstSum, uSts.armSum, uSts.runeAtt, uSts.runeDef, uSts.innate = calcStats(unitStats [name] .info)
Link to comment
Share on other sites

Code:
local function  calcStats(Sts)
---- для каждого слота одежки
local cnt, stsAll, rstAll, armAll, stsSum, rstSum, armSum, runeAtt, runeDef = 0, 0, 0, 0, 0, 0, 0, 0, 0
---local myDress = unit.GetEquipmentItemIds( Me, ITEM_CONT_EQUIPMENT )
local mySts, mySts1, val, itemId, myInfo
---exObj("Sts", Sts)
---LogInfo("calcStats")
local stsInn = {}
for slot, v in Sts do
if type(slot) == "number" then
cnt = cnt + 1
itemId = unit.GetEquipmentItemId( Me, slot, ITEM_CONT_EQUIPMENT )
if v.rune then
--- тут руна 28-29-30 слоты - атака, защита
---myInfo = avatar.GetItemInfo( itemId )
---exObj("myRune:"..slot, myInfo.runeInfo)
---LogToChat(slot..":"..v.rune.runeLevel)
if slot <31 then
--- это атакующие
runeAtt = runeAtt + v.rune.runeLevel
else
runeDef = runeDef + v.rune.runeLevel
end
else
Link to comment
Share on other sites

Code:
function tryToInspect(name, id)
local uSts = unitStats [name] 
if uSts then return uSts end --- не каждый раз смотреть а раз в минуту примерно
tryToInspectON = true
if getVersionAO() <= 2 then avatar.StartInspect()
elseif object.IsExist(id) then avatar.StartInspect(id)
else
tryToInspectON = nil
end
end
Link to comment
Share on other sites

суть в том что надо сначала вызвать функцию - инспектировать персонажа ---- avatar.StartInspect()

потом поймать событие - что инспекция началась --- onEvent.EVENT_INSPECT_STARTED = function( pars )

вот тогда быстренько снять с него копию одежки ---- Inspect()

и потом ее уже обработать --- calcStats(Sts)

Link to comment
Share on other sites

Code:
local function Inspect(unitId, dressed)
local dress = dressed or {}

-- [[ -- пашет! - драконий облик:
for slot, id in unit.GetEquipmentItemIds(unitId,ITEM_CONT_EQUIPMENT_RITUAL  ) do
--- ITEM_CONT_INVENTORY - не пашет
LogInfo( slot, ":", id)
end
--] ]

local info
for slot, id in unit.GetEquipmentItemIds(unitId,ITEM_CONT_EQUIPMENT) do
info =  avatar.GetItemInfo( id )
---exObj("info",info)
if info and info.runeInfo then
--- это руна - она без бонусов
---exObj("bonus",avatar.GetItemBonus(id))
dress [slot]  = { rune = info.runeInfo }
---elseif info and FromWS(info.name) then
-- [[elseif info.sysClassName="Shield" then
dress[slot]  = avatar.GetItemBonus(id)
dress [slot]  = --]]
else
---exObj("info",info)
dress [slot]  = avatar.GetItemBonus(id)
end
end

if tryToInspectON then
--- если это аддон инициировал то закончим
avatar.EndInspect()
tryToInspectON = nil
end
---avatar.UnselectTarget()
---exObj("dress", dress)
return dress

end
Link to comment
Share on other sites

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

By using our site you agree to the Terms of Use