- Joined
- Feb 15, 2009
- Messages
- 463
I use the Intuitive Damage Detection System by Rising_Dusk but i am doing something wrong maybe you can help me here is the trigger
When i used the AttackEvent before it worked but you all know about the problem u can get out of this
only question how can i get this work with the IDDS(Intuitive Damage Detection System)
Thx Saia_Djinn
Till yet im getting a freeze on the attack after which it should trigger
it is not triggering on the attack before
When i used the AttackEvent before it worked but you all know about the problem u can get out of this
only question how can i get this work with the IDDS(Intuitive Damage Detection System)
Thx Saia_Djinn
Till yet im getting a freeze on the attack after which it should trigger
it is not triggering on the attack before
JASS:
//***************************************************************************
//** **
//** Explosive Stump by Saia_Djinn **
//** **
//** Requires: **
//** GroupUtils , xedamage ,Rising_Dusks Knockbacksystem v.1.03 , IDDS **
//** and a Steermanfunction **
//***************************************************************************
scope ExplosiveStump initializer Init
globals
//ENUM_GROUP comes from the GroupUtils library
//////////////////////////////////////////CONFIGURATION/////////////////////////////////////////////////////////////////////////////////////////////////
private constant integer Id = 'A002'
//The Spell Id
private constant integer BaseCounter = 7
//The Counter detecting when the Leg explodes (6 at level one you can get this value for level 1 by substract LvlFactor from BaseCounter
private constant string FxPath = "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl"
//The Path of the Fx shown at explosion
private constant string FxAttach = "origin"
//The Attachpoint of the explosion fx
private constant string DmgFxPath = "Objects\\Spawnmodels\\Human\\HCancelDeath\\HCancelDeath.mdl"
//The Fx shown on damaged units
private constant string DmgFxAttach = "origin"
//The Attachmentpoint for dmgFX
private constant real LvlFactor = 1.
//Counter going down by LvlFactor per Level
private constant real DmgLvlFactor = 20.
//Dmg per Level
private constant real Radius = 200.
//The AOE of the Spell
private constant real KnockRange = 250.
//How far Units get knocked back
private constant real KnockDecrement = 12.5
//How many speed they loose per intervall(intervall variable is in Knockbacksystem)
private constant boolean KillDestructs = true
//kill Trees hitted by kocked back units?
private constant boolean KnockAdjacent = false
//knock units back which get hit by a knocked unit?
private constant boolean ChainAdjacent = false
//make the same as in KnockAdjacent again and again?
private constant attacktype At = ATTACK_TYPE_MAGIC
//ATTACKTYPE of the Dmg
private constant damagetype Dt = DAMAGE_TYPE_FIRE
//DAMAGETYPE of the Dmg
private constant weapontype Wt = WEAPON_TYPE_WHOKNOWS
//WEAPONTYPE of the Dmg
private constant boolean DmgSelf = false
//name explains i think
private constant boolean DmgAlly = false
//name explains i think
private constant boolean DmgEnemy = true
//name explains i think
private constant boolean DmgNeutral = true
//name explains i think
private constant boolean KillTrees = false
//kill Trees being in the DamageAOE ?
//////////////////////////////////////////END/////////////////////////////////////////////////////////////////////////////////////////////////
//REQUIRED
private integer Counter = 0
private effect Fx
private xedamage Damage
private unit Temp
private boolexpr MatchBoolExpr
endglobals
private function SetItUp takes nothing returns nothing
set Damage.damageSelf = DmgSelf
set Damage.damageAllies = DmgAlly
set Damage.damageEnemies = DmgEnemy
set Damage.damageNeutral = DmgNeutral
set Damage.damageTrees = KillTrees
call Damage.useSpecialEffect(DmgFxPath , DmgFxAttach)
set Damage.dtype = Dt
set Damage.atype = At
set Damage.wtype = Wt
call XE_PreloadAbility(Id)
call Preload(DmgFxPath)
call Preload(FxPath)
endfunction
private function Match takes nothing returns boolean
return IsUnitEnemy( GetFilterUnit() , GetOwningPlayer( Temp )) and Steerman_GroupMatch()
endfunction
private function Callback takes nothing returns nothing
local unit t = GetEnumUnit()
local real ang = 57.29582 * Atan2(GetUnitY(t) - GetUnitY(Temp), GetUnitX(t) - GetUnitX(Temp))
call KnockbackTarget( Temp , t , ang, KnockRange , KnockDecrement , KillDestructs , KnockAdjacent , ChainAdjacent )
endfunction
private function Conditions takes nothing returns boolean
local unit u
if GetUnitAbilityLevel( GetTriggerDamageSource() , Id ) > 0 then
set u = GetTriggerDamageSource()
if Counter >= (BaseCounter - (R2I(LvlFactor) * GetUnitAbilityLevel( u , Id ))) then
set Fx = AddSpecialEffectTarget( FxPath , u , FxAttach)
set Temp = u
call GroupRefresh(ENUM_GROUP)
call GroupEnumUnitsInRange( ENUM_GROUP , GetUnitX(u) , GetUnitY(u) , Radius ,MatchBoolExpr )
call ForGroup( ENUM_GROUP , function Callback )
call Damage.damageGroup(u , ENUM_GROUP , DmgLvlFactor * GetUnitAbilityLevel( u , Id ))
set Counter = 0
call DestroyEffect(Fx)
set Fx = null
else
set Counter = Counter + 1
endif
endif
return false
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterDamageEvent( t , 5 )
call TriggerAddCondition( t , Condition(function Conditions ))
set MatchBoolExpr = Condition( function Match )
set Damage = xedamage.create()
call SetItUp()
endfunction
endscope