Древо Талантов

qofma

Активный
1 Апр 2016
81
0
Где найти сие чудо и есть ли у древа настройки ?А то допустим мне нужно 4 таланта на выбор ,а не 2 или уровень прокачки талантов поменять
 

ZLOY

Администратор
Команда форума
27 Июн 2016
953
182
Стандартное искореняешь, свое пишешь
Со стандартным - максимум заменить абилки на свои
 

Adam Smith

Друзья CG
4 Окт 2014
473
2
Код:
if Talents == nil then
	Talents = {}
	Talents.__index = Talents
end

function Talents:HasTalent(hero, talentName)
  if hero:HasAbility(talentName) then
    if hero:FindAbilityByName(talentName):GetLevel() > 0 then return true end
  end
  return false
end
function Talents:FindTalentValue(hero, talentName)
  if hero:HasAbility(talentName) then
    return hero:FindAbilityByName(talentName):GetSpecialValueFor("value")
  end
  return nil
end

function Talents:GetTalentSpecialValueFor(ability, value)
  local base = ability:GetSpecialValueFor(value)
  local talentName
  local kv = ability:GetAbilityKeyValues()
  for k,v in pairs(kv) do -- trawl through keyvalues
    if k == "AbilitySpecial" then
      for l,m in pairs(v) do
        if m[value] then
          talentName = m["LinkedSpecialBonus"]
        end
      end
    end
  end
  if talentName then 
    local talent = ability:GetCaster():FindAbilityByName(talentName)
    if talent and talent:GetLevel() > 0 then base = base + talent:GetSpecialValueFor("value") end
  end
  return base
end

Код:
if Talents:HasTalent(self:GetCaster(), "special_bonus_unique_tzeench") then
    local value = Talents:FindTalentValue(self:GetCaster(), "special_bonus_unique_tzeench")
    self.mana_dmg = self:GetCaster():GetMana()*((self:GetSpecialValueFor("mana_pool_ptc") + value)/100)
  end
 
Последнее редактирование модератором:
Реклама: