Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Trig_SummonSkeleton_Conditions takes nothing returns boolean
- return ( GetSpellAbilityId() == 'A00C' )
- endfunction
- function Trig_SummonSkeleton_Actions takes nothing returns nothing
- local unit UnitCast = GetTriggerUnit()
- local unit UnitSpawn
- local location LocCaster = GetUnitLoc(UnitCast)
- local player PlayerCast = GetOwningPlayer( UnitCast )
- local integer CastLevel = GetUnitAbilityLevel( UnitCast, GetSpellAbilityId() )
- local real RealScale = 0.6+(1.6*(I2R(CastLevel)/30))
- local integer IntLoop = 1
- set UnitSpawn = CreateUnitAtLoc(PlayerCast, 'u007', LocCaster, 270.00)
- //Lebenspunkte
- loop
- call UnitAddAbility(UnitSpawn, 'A00Q')
- call SetUnitAbilityLevel(UnitSpawn, 'A00Q', 2)
- call UnitRemoveAbility(UnitSpawn, 'A00Q')
- set IntLoop = IntLoop+1
- exitwhen IntLoop > CastLevel
- endloop
- //Schaden und Rüstung
- call UnitAddAbility(UnitSpawn, 'A01F')
- call SetUnitAbilityLevel(UnitSpawn, 'A01F', CastLevel)
- call UnitAddAbility(UnitSpawn, 'A01L')
- call SetUnitAbilityLevel(UnitSpawn, 'A01L', CastLevel)
- //Sonstige Einstellungen
- call UnitAddTypeBJ( UNIT_TYPE_SUMMONED, UnitSpawn )
- call UnitApplyTimedLifeBJ( 60.00, 'BTLF', UnitSpawn )
- call SetUnitScale(UnitSpawn, RealScale, RealScale, RealScale)
- //Ausrüstung
- //Waffen
- if (CastLevel >= 25) then
- call AddSpecialEffectTargetUnitBJ( "weapon,right", UnitSpawn, "Items\\Weapons\\SwordOfDarkness.mdx" )
- elseif (CastLevel >= 18) then
- call AddSpecialEffectTargetUnitBJ( "weapon,right", UnitSpawn, "Items\\Weapons\\UndeadAssassinSword.mdx" )
- elseif (CastLevel >= 12) then
- call AddSpecialEffectTargetUnitBJ( "weapon,right", UnitSpawn, "Items\\Weapons\\Axe.mdx" )
- elseif (CastLevel >= 7) then
- call AddSpecialEffectTargetUnitBJ( "weapon,right", UnitSpawn, "Items\\Weapons\\AcolyteDagger.mdx" )
- elseif (CastLevel >= 3) then
- call AddSpecialEffectTargetUnitBJ( "weapon,right", UnitSpawn, "Items\\Weapons\\Sickle.MDX" )
- endif
- //Schilde
- if (CastLevel >= 22) then
- call AddSpecialEffectTargetUnitBJ( "sprite,left", UnitSpawn, "Items\\Shields\\GoldenShield.mdx" )
- elseif (CastLevel >= 18) then
- call AddSpecialEffectTargetUnitBJ( "sprite,left", UnitSpawn, "Items\\Shields\\SteelShield.mdx" )
- elseif (CastLevel >= 12) then
- call AddSpecialEffectTargetUnitBJ( "sprite,left", UnitSpawn, "Items\\Shields\\OrcShield.mdx" )
- elseif (CastLevel >= 6) then
- call AddSpecialEffectTargetUnitBJ( "sprite,left", UnitSpawn, "Items\\Shields\\UndeadShield.mdx" )
- endif
- call TriggerSleepAction( 2.00 )
- //Leaks entfernen
- call RemoveLocation(LocCaster)
- set UnitCast = null
- set UnitSpawn = null
- set PlayerCast = null
- set LocCaster = null
- endfunction
- //===========================================================================
- function InitTrig_SummonSkeleton takes nothing returns nothing
- set gg_trg_SummonSkeleton = CreateTrigger( )
- call TriggerRegisterAnyUnitEventBJ( gg_trg_SummonSkeleton, EVENT_PLAYER_UNIT_SPELL_EFFECT )
- call TriggerAddCondition( gg_trg_SummonSkeleton, Condition( function Trig_SummonSkeleton_Conditions ) )
- call TriggerAddAction( gg_trg_SummonSkeleton, function Trig_SummonSkeleton_Actions )
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement