Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function HeroService:SetDruidShapeshiftForm(hero, form)
- if hero.isInSpellbook then
- hero:GetAbilityByIndex(5):OnSpellStart()
- end
- local ability = hero:FindAbilityByName("customability_druid_shapeshift_random")
- if not ability then
- ability = hero:GetAbilityByIndex(5)
- end
- local level = ability:GetLevel()
- hero:RemoveAbility(ability:GetName())
- ability = hero:AddAbility("customability_druid_shapeshift_" .. form)
- ability:SetLevel(level)
- hero.shapeshiftForm = form
- Event:Trigger("update_save_data", {
- playerID = hero:GetPlayerOwnerID(),
- system = "HeroData",
- key = "shapeshift_form",
- value = form
- })
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement