Moderator
M
Moderator
17:31, 9th Nov 2009
TriggerHappy187:
A bunch of BJ's and a demo map which does nothing.
TriggerHappy187:
A bunch of BJ's and a demo map which does nothing.
return GroupTypeUnitMatch()
return GroupTypeUnitImmuneMatch()
return GroupTypeUnitAllMatch()
scope Spell initializer Init
globals
private constant integer Spell_Id
private boolexpr Con
private unit Temp
endglobals
private function Match takes nothing returns nothing
return IsUnitEnemy(GetFilterUnit() , GetOwningPlayer(Temp)) and GroupTypeHeroMatch()
endfunction
private function Conditions takes nothing returns boolean
local unit u
local group g
if GetSpellAbiliyId() == Spell_Id then
set u = GetTriggerUnit()u
set g = CreateGroup() //NewGroup() if GroupUtils
set Temp = u
call GroupEnumUnitsInRange(g , x , y ,AOE , Con)
//finish now your group is filled with the EnemyHeros
//do rest stuff here....
endif
return false
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
set Con = Condition(function Match)
//the usual rest : Add Condition ... Init Variables
endfunction
endscope
//**************Matching Utils *************************
//* *
//* v.2.a *
//* *
//* by Saia_Djinn *
//* *
//* *
//* Contains the most usual FilterFunctions *
//* *
//* Credits: maskedpoptart for IsUnitDead() *
//****************************************************
// USAGE
// An Example shows best how to use this:
// function Match takes nothing returns boolean
// return IsUnitAlly( GetFilterUnit() , GetOwningPlayer(Temp)) and GroupUnitMatch()
// endfunction
// This would send a true for all allied units not being immune or a structure in the Filter
//Only thing you should most times call before this in a Match function is:
// IsUnitAlly() or IsUnitEnemy() or nothing if you want friendly fire
//for sure you can also call other function before this just simplifies some
// Contains some functions to simplify Catching units in a Filter and to don't have to type it everytime again
// Credits should be given
library MatchingUtils
function IsUnitDead takes unit u returns boolean // by maskedpoptart
return IsUnitType(u, UNIT_TYPE_DEAD) or GetUnitTypeId(u) == 0
endfunction
function GroupTypeUnitMatch takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO ) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeUnitImmuneMatch takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO ) and IsUnitDead(GetFilterUnit()) ) == false and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)
endfunction
function GroupTypeUnitAllMatch takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO ) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeHeroMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO ) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeHeroImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO ) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeHeroAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO ) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeStructureMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeStructureImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_STRUCTURE) and IsUnitType(GetFilterUnit() , UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeStructureAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_STRUCTURE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeMovableMatch takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeMovableImmuneMatch takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitDead(GetFilterUnit()) ) == false and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)
endfunction
function GroupTypeMovableAllMatch takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeFlyingMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_FLYING) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeFlyingImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_FLYING) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeFlyingAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_FLYING) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeGroundMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_GROUND) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeGroundImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_GROUND) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeGroundAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_GROUND) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeMechanicalMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_MECHANICAL) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeMechanicalImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_MECHANICAL) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeMechanicalAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_MECHANICAL) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeAncientMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_ANCIENT) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeAncientImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_ANCIENT) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeAncientAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_ANCIENT) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeUndeadMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_UNDEAD) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeUndeadImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_UNDEAD) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeUndeadAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_UNDEAD) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeTaurenMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_TAUREN) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) ) == false
endfunction
function GroupTypeTaurenImmuneMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_TAUREN) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitDead(GetFilterUnit()) == false
endfunction
function GroupTypeTaurenAllMatch takes nothing returns boolean
return IsUnitType(GetFilterUnit() , UNIT_TYPE_TAUREN) and IsUnitDead(GetFilterUnit()) == false
endfunction
endlibrary