Bantas Anomalie floodiforme
Inscrit le: 21 Aoû 2007 Messages: 1524 Sujets: 37
Médailles: 1 (En savoir plus...)
|
Posté le: 25/08/07 18:35 Sujet du message: UnitDamageEnemies |
|
|
Nom de la fonction : UnitDamageEnemies
Créateur : Bantas
Fonctions requises : Aucune
Code : Jass: | function UnitDamageEnemies takes unit whichUnit, real radius, real x, real y, real amount, attacktype attackType, damagetype damageType returns nothing
local group g = CreateGroup()
local unit u = null
local player p = GetOwningPlayer(whichUnit)
call GroupEnumUnitsInRange(g,x,y,radius,null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
if (IsUnitEnemy(u,p)) then
call UnitDamageTarget(whichUnit,u,amount,false,false,attackType,damageType,WEAPON_TYPE_WHOKNOWS)
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g = null
set p = null
endfunction |
Utilisation : Quand on fait un sort, il est toujours gênant de frapper ses alliés.. UnitDamageEnemies équivaut à UnitDamageArea, mais vous ne frapperez que les ennemis.
Copyright : Non _________________
|
|