Advertisement
Rhutos

SummonSkeleton

Jul 13th, 2012
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
J 3.11 KB | None | 0 0
  1. function Trig_SummonSkeleton_Conditions takes nothing returns boolean
  2.     return ( GetSpellAbilityId() == 'A00C' )
  3. endfunction
  4.  
  5. function Trig_SummonSkeleton_Actions takes nothing returns nothing
  6. local unit UnitCast = GetTriggerUnit()
  7. local unit UnitSpawn
  8. local location LocCaster = GetUnitLoc(UnitCast)
  9. local player PlayerCast = GetOwningPlayer( UnitCast )
  10. local integer CastLevel = GetUnitAbilityLevel( UnitCast, GetSpellAbilityId() )
  11. local real RealScale = 0.6+(1.6*(I2R(CastLevel)/30))
  12. local integer IntLoop = 1
  13.  
  14. set UnitSpawn = CreateUnitAtLoc(PlayerCast, 'u007', LocCaster, 270.00)
  15. //Lebenspunkte
  16. loop
  17.     call UnitAddAbility(UnitSpawn, 'A00Q')
  18.     call SetUnitAbilityLevel(UnitSpawn, 'A00Q', 2)
  19.     call UnitRemoveAbility(UnitSpawn, 'A00Q')
  20.     set IntLoop = IntLoop+1
  21.     exitwhen IntLoop > CastLevel
  22. endloop
  23. //Schaden und Rüstung
  24. call UnitAddAbility(UnitSpawn, 'A01F')
  25. call SetUnitAbilityLevel(UnitSpawn, 'A01F', CastLevel)
  26. call UnitAddAbility(UnitSpawn, 'A01L')
  27. call SetUnitAbilityLevel(UnitSpawn, 'A01L', CastLevel)
  28. //Sonstige Einstellungen
  29. call UnitAddTypeBJ( UNIT_TYPE_SUMMONED, UnitSpawn )
  30. call UnitApplyTimedLifeBJ( 60.00, 'BTLF', UnitSpawn )
  31. call SetUnitScale(UnitSpawn, RealScale, RealScale, RealScale)
  32. //Ausrüstung
  33. //Waffen
  34. if (CastLevel >= 25) then
  35.     call AddSpecialEffectTargetUnitBJ( "weapon,right", UnitSpawn, "Items\\Weapons\\SwordOfDarkness.mdx" )
  36. elseif (CastLevel >= 18) then
  37.     call AddSpecialEffectTargetUnitBJ( "weapon,right", UnitSpawn, "Items\\Weapons\\UndeadAssassinSword.mdx" )
  38. elseif (CastLevel >= 12) then
  39.     call AddSpecialEffectTargetUnitBJ( "weapon,right", UnitSpawn, "Items\\Weapons\\Axe.mdx" )
  40. elseif (CastLevel >= 7) then
  41.     call AddSpecialEffectTargetUnitBJ( "weapon,right", UnitSpawn, "Items\\Weapons\\AcolyteDagger.mdx" )
  42. elseif (CastLevel >= 3) then
  43.     call AddSpecialEffectTargetUnitBJ( "weapon,right", UnitSpawn, "Items\\Weapons\\Sickle.MDX" )
  44. endif
  45. //Schilde
  46. if (CastLevel >= 22) then
  47.     call AddSpecialEffectTargetUnitBJ( "sprite,left", UnitSpawn, "Items\\Shields\\GoldenShield.mdx" )
  48. elseif (CastLevel >= 18) then
  49.     call AddSpecialEffectTargetUnitBJ( "sprite,left", UnitSpawn, "Items\\Shields\\SteelShield.mdx" )
  50. elseif (CastLevel >= 12) then
  51.     call AddSpecialEffectTargetUnitBJ( "sprite,left", UnitSpawn, "Items\\Shields\\OrcShield.mdx" )
  52. elseif (CastLevel >= 6) then
  53.     call AddSpecialEffectTargetUnitBJ( "sprite,left", UnitSpawn, "Items\\Shields\\UndeadShield.mdx" )
  54. endif
  55. call TriggerSleepAction( 2.00 )
  56.  
  57. //Leaks entfernen
  58. call RemoveLocation(LocCaster)
  59. set UnitCast = null
  60. set UnitSpawn = null
  61. set PlayerCast = null
  62. set LocCaster = null
  63. endfunction
  64.  
  65. //===========================================================================
  66. function InitTrig_SummonSkeleton takes nothing returns nothing
  67.     set gg_trg_SummonSkeleton = CreateTrigger(  )
  68.     call TriggerRegisterAnyUnitEventBJ( gg_trg_SummonSkeleton, EVENT_PLAYER_UNIT_SPELL_EFFECT )
  69.     call TriggerAddCondition( gg_trg_SummonSkeleton, Condition( function Trig_SummonSkeleton_Conditions ) )
  70.     call TriggerAddAction( gg_trg_SummonSkeleton, function Trig_SummonSkeleton_Actions )
  71. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement