Login
Register
Menu
Home
Forum
JassDoc
Types
Functions
Variables
Help
Chat
Media
Search
Search posts
WC3 JASS.com
"The Jass Vault" plus vJASS and Zinc
WC3 Modding Information Center
Forum
Warcraft (WC3) Modding
Warcraft III Resources
Warcraft III Spells and Systems
Codes & Snippets
InvulnerabilityChecker
Warcraft III:
Maps
Models
Skins
Icons
Spells / Systems
Tools
Tutorials
Snippets
JASS vJASS Spells and Systems
Tutorials
Chat @Discord
vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation
-
Zinc documentation
-
WC3 Optimizer documentation
InvulnerabilityChecker
Codes & Snippets
Started by
AGD
Views
5780
Replies
0
Users
1
1
Pages:
1
Go Down
0 Members and 1 Guest are viewing this topic.
AGD
Newbie - level 1
Posts:
14
WC3 Models: 0
WC3 Tutorials: 0
WC3 Tools: 0
WC3 Maps: 0
WC3 Skins: 0
WC3 Icons: 0
WC3 Spells: 0
Reputation:
0
Just a Man in the Back
InvulnerabilityChecker
on:
September 04, 2016, 12:09:44 AM
Category:
Units
Language:
vJASS
A simple snippet used to check if a unit is invulnerable. False positives from mana shields are also accounted for.
Code: jass
library
InvulnerabilityChecker
function
CheckInvulnerability
takes
unit
u
returns
boolean
local
real
origHP =
GetWidgetLife
(u)
local
real
origMP =
GetUnitState
(u,
UNIT_STATE_MANA
)
local
boolean
check
call
UnitDamageTarget
(u, u, 0.01,
true
,
false
,
ATTACK_TYPE_NORMAL
,
DAMAGE_TYPE_UNIVERSAL
,
null
)
set
check =
GetWidgetLife
(u) == origHP
and
GetUnitState
(u,
UNIT_STATE_LIFE
) == origMP
call
SetWidgetLife
(u, origHP)
call
SetUnitState
(u,
UNIT_STATE_MANA
, origMP)
return
check
endfunction
endlibrary
«
Last Edit: December 19, 2017, 10:58:03 PM by moyack
»
Print
Pages:
1
Go Up
« previous
next »
WC3 Modding Information Center
Forum
Warcraft (WC3) Modding
Warcraft III Resources
Warcraft III Spells and Systems
Codes & Snippets
InvulnerabilityChecker
PortaMx-SEF 1.54
|
PortaMx © 2008-2015
,
PortaMx corp.
Search
Username
Password
Always stay logged in
Forgot your password?