[Archive] Flag Question
[Archive] Flag Question
Archived author: Peacy • Posted: 2016-03-04T16:56:37+00:00
Original source
Hey Guys,
I have this NPC that is unattackable because I get it's unit_flags in the trinity database to 2. I want this npc to stay unattackable untill players trigger a certain event. Upon this event being triggered I want him to become attackable and I'm not sure how to do this.
I'm using npc_bal:SetInt32Value(UNIT_FLAG_ATTACKABLE) at the moment but it's not working! Any other ideas?
Thanks, Peacy!
Archived author: Grindi • Posted: 2016-03-04T17:04:16+00:00
Original source
You should use UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_ATTACKABLE_1, UNIT_FLAG_IMMUNE_TO_PC, UNIT_FLAG_IMMUNE_TO_NPC.
You can read more about this flags here - https://trinitycore.atlassian.net/wiki/d...e_template
Archived author: Amaroth • Posted: 2016-03-04T17:59:18+00:00
Original source
A way around would be using friendly reputation, which would be changed into hostile reputation when some event occurs. Such script could be easily done even in SmartAI.
Quote: 1 hour ago, Grindi said:Would
You should use UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_ATTACKABLE_1, UNIT_FLAG_IMMUNE_TO_PC, UNIT_FLAG_IMMUNE_TO_NPC.
You can read more about this flags here - https://trinitycore.atlassian.net/wiki/d...e_template
Archived author: Peacy • Posted: 2016-03-04T18:31:15+00:00
Original source
Quote: 1 hour ago, Grindi said:Would
You should use UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_ATTACKABLE_1, UNIT_FLAG_IMMUNE_TO_PC, UNIT_FLAG_IMMUNE_TO_NPC.
You can read more about this flags here - https://trinitycore.atlassian.net/wiki/d...e_template
Archived author: Peacy • Posted: 2016-03-05T00:14:59+00:00
Original source
Anyone Know how to solve this issue?
Archived author: Kaev • Posted: 2016-03-05T09:50:08+00:00
Original source
Set it with
npc->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
and remove it with
npc->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);