Advertisement
Guest User

heroservice.lua changes

a guest
Jan 17th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. function HeroService:SetDruidShapeshiftForm(hero, form)
  2.     if hero.isInSpellbook then
  3.         hero:GetAbilityByIndex(5):OnSpellStart()
  4.     end
  5.  
  6.     local ability = hero:FindAbilityByName("customability_druid_shapeshift_random")
  7.     if not ability then
  8.         ability = hero:GetAbilityByIndex(5)
  9.     end
  10.     local level = ability:GetLevel()
  11.     hero:RemoveAbility(ability:GetName())
  12.  
  13.     ability = hero:AddAbility("customability_druid_shapeshift_" .. form)
  14.     ability:SetLevel(level)
  15.  
  16.     hero.shapeshiftForm = form
  17.  
  18.     Event:Trigger("update_save_data", {
  19.         playerID = hero:GetPlayerOwnerID(),
  20.         system = "HeroData",
  21.         key = "shapeshift_form",
  22.         value = form
  23.     })
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement