Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inspire_lua = class({})
- function ApplyInspire(keys)
- print("Applying Inspire.");
- local caster = keys.caster
- local ability = keys.ability
- local target = keys.target
- local stack_modifier = keys.stack_modifier
- local stack_count = target:GetModifierStackCount(stack_modifier, ability)
- ability:ApplyDataDrivenModifier(caster, target, stack_modifier, {})
- target:SetModifierStackCount(stack_modifier, ability, stack_count + 1)
- print(stack_count + 1)
- end
- function RemoveInspire(keys)
- local caster = keys.caster
- local target = keys.target
- local ability = keys.ability
- local stack_modifier = keys.stack_modifier
- local stack_count = target:GetModifierStackCount(stack_modifier, ability)
- if stack_count <= 1 then
- target:RemoveModifierByName(stack_modifier)
- else
- target:SetModifierStackCount(stack_modifier, ability, stack_count - 1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment