![]() |
#1 |
Procrastination Incarnate
Development Director
|
![]() A simple function that should be very useful when making spells compatible with standard melee gameplay; I feel it's just long enough to warrant it's own library, which for the sake of completeness includes the function IsUnitSpellImmune.
__________________![]() library IsUnitSpellResistant //***************************************************************** //* IsUnitSpellResistant //* //* written by: Anitarf //* //* In WC3, most debuff and stun spells have a decreased duration //* against heroes, creeps with a high enough level and units with //* resistant skin, while other spells such as Polymorph don't //* even work against such units. This function checks if a unit //* matches any of these criteria that would make it resistant to //* such spells, so you can make triggered spells work that way. //***************************************************************** globals private constant integer CREEP_RESISTANCE_LEVEL = 6 //the level at which creeps gain spell resistance endglobals function IsUnitSpellResistant takes unit u returns boolean return IsUnitType(u, UNIT_TYPE_HERO) or IsUnitType(u, UNIT_TYPE_RESISTANT) or (GetPlayerId(GetOwningPlayer(u))>11 and GetUnitLevel(u)>=CREEP_RESISTANCE_LEVEL) endfunction function IsUnitSpellImmune takes unit u returns boolean return IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE) endfunction endlibrary |
![]() |
![]() |
Sponsored Links - Login to hide this ad! |
|
![]() |
#2 |
Corkscrew Chainsaw!!!
|
![]() Use of or would get it inlined, and be faster.
__________________![]() |
![]() |
![]() |
![]() |
#3 |
Procrastination Incarnate
Development Director
|
![]() Actually, it won't get inlined by the current JassHelper, but Vex said that in the future it might be so I updated it anyway.
__________________ |
![]() |
![]() |
![]() |
#4 |
Lackadaisically Absent.
Respected User
|
![]() I don't know if I'm overstepping my authority, but I approve.
__________________And we need to start cleaning up the submissions here, so moving this one on its merry way should be a good thing. |
![]() |
![]() |
![]() |
#5 |
User
Join Date: Apr 2011
Posts: 6
![]() |
![]() Is there any way to change the level at which creeps become resistant? I couldn't find a gameplay constant or anything similar.
Also, does IsUnitType(u, UNIT_TYPE_RESISTANT) depend solely on whether the unit has a Resistant Skill ability? |
![]() |
![]() |
![]() |
#6 | ||
Procrastination Incarnate
Development Director
|
![]() Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#7 |
User
|
![]() Thank you, this script is really useful.
__________________ |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
|