O Ilusionista
Captain 100K
Hi there.
I am trying to make this work but I am missing something.
I want to make some entities totally imune to ATTACK17 using ondoattack. I know I could use a defense setting, but I need to use ondoattack because I want to nullify the attack completly (no hitfx, no flash, etc)
This is the code I am using
What I am missing here?
I am trying to make this work but I am missing something.
I want to make some entities totally imune to ATTACK17 using ondoattack. I know I could use a defense setting, but I need to use ondoattack because I want to nullify the attack completly (no hitfx, no flash, etc)
This is the code I am using
Code:
void main()
{
void self; // Entity running event
void other; // Entity attacking or receiving vs. self.
int which; // Attacker or defender event?
int id_hit_by; // Entity ID of entity attack hit.
int id_attack; // Entity ID of entity that performed attack.
Type = getlocalvar("attacktype");// Get attack type
self = getlocalvar("self");
other = getlocalvar("other");
which = getlocalvar("which");
// Is this a defending event?
if(!which))
{
// IDs are not the same? This is how we prevent repeat
// hits from the same attack.
hit_by_id = getentityproperty(self, "hitbyid");
attack_id = getlocalvar("attackid");
if(hit_by_id != attack_id) && (Type=="ATK_NORMAL17")
{
changeopenborvariant("lasthitc", 0);
}
}
// Set hit id on self to attack ID for the next cycle.
changeentityproperty(self, "hitbyid", hit_by_id);
}
What I am missing here?