Guest adolf Posted February 10, 2011 Share Posted February 10, 2011 Кто подскажет - как достать информацию о рунах? Чет уже два дня мучаюсь ничего не получается. Quote Link to comment Share on other sites More sharing options...
Guest adolf Posted February 10, 2011 Share Posted February 10, 2011 Даже не так=) не просто о рунах, а о рунах инспектируемого игрока. ну и своих тоже можно=) чет в апи я ничего что могло бы явно указывать на то как это сделать не нашел. устал, мозг взрывается=) Quote Link to comment Share on other sites More sharing options...
Nikon Posted February 10, 2011 Share Posted February 10, 2011 Начиная с АО 2.0.02 руны стали одетым шмотом unit.GetEquipmentItemIds( unitId, ITEM_CONT_EQUIPMENT) + avatar.GetItemInfo( itemId ).runeInfo Quote Link to comment Share on other sites More sharing options...
Guest adolf Posted April 7, 2011 Share Posted April 7, 2011 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 что я делаю не так? Quote Link to comment Share on other sites More sharing options...
Guest adolf Posted April 7, 2011 Share Posted April 7, 2011 del/ Quote Link to comment Share on other sites More sharing options...
Nikon Posted April 7, 2011 Share Posted April 7, 2011 Страшный набор буков Результат то какой? 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 Quote Link to comment Share on other sites More sharing options...
Guest adolf Posted April 7, 2011 Share Posted April 7, 2011 Спасибо Nikon, 1 вариант работает=) Quote Link to comment Share on other sites More sharing options...
Wanderer Posted August 3, 2011 Share Posted August 3, 2011 перепробовал оба варианта ни один не работает. есть идеи как реанимировать сиё? Quote Link to comment Share on other sites More sharing options...
icreator Posted August 4, 2011 Share Posted August 4, 2011 ну в аддоне TargetsManager TargetsManager это делается там надо ловить события - просто так ничего не получится Quote Link to comment Share on other sites More sharing options...
Wanderer Posted August 4, 2011 Share Posted August 4, 2011 скрипт скомпилен, как понимаю в TargetsManager.luac эта функция Quote Link to comment Share on other sites More sharing options...
icreator Posted August 17, 2011 Share Posted August 17, 2011 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) Quote Link to comment Share on other sites More sharing options...
icreator Posted August 17, 2011 Share Posted August 17, 2011 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 Quote Link to comment Share on other sites More sharing options...
icreator Posted August 17, 2011 Share Posted August 17, 2011 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 Quote Link to comment Share on other sites More sharing options...
icreator Posted August 17, 2011 Share Posted August 17, 2011 суть в том что надо сначала вызвать функцию - инспектировать персонажа ---- avatar.StartInspect() потом поймать событие - что инспекция началась --- onEvent.EVENT_INSPECT_STARTED = function( pars ) вот тогда быстренько снять с него копию одежки ---- Inspect() и потом ее уже обработать --- calcStats(Sts) Quote Link to comment Share on other sites More sharing options...
icreator Posted August 17, 2011 Share Posted August 17, 2011 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 Quote Link to comment Share on other sites More sharing options...
Wanderer Posted August 18, 2011 Share Posted August 18, 2011 Спасибо Quote Link to comment Share on other sites More sharing options...
Recommended Posts