Forums WoW Modding Discussion Serverside [Archive] Flag Question

[Archive] Flag Question

[Archive] Flag Question

rektbyfaith
Administrator
0
03-04-2016, 04:56 PM
#1
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!
rektbyfaith
03-04-2016, 04:56 PM #1

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!

rektbyfaith
Administrator
0
03-04-2016, 05:04 PM
#2
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
rektbyfaith
03-04-2016, 05:04 PM #2

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

rektbyfaith
Administrator
0
03-04-2016, 05:59 PM
#3
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.
rektbyfaith
03-04-2016, 05:59 PM #3

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.

rektbyfaith
Administrator
0
03-04-2016, 06:31 PM
#4
Archived author: Peacy • Posted: 2016-03-04T18:31:15+00:00
Original source

Quote: 1 hour ago, Grindi said:

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
Would

UNIT_FLAG_NOT_ATTACKABLE_1

 make the npc attackable?
rektbyfaith
03-04-2016, 06:31 PM #4

Archived author: Peacy • Posted: 2016-03-04T18:31:15+00:00
Original source

Quote: 1 hour ago, Grindi said:

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
Would

UNIT_FLAG_NOT_ATTACKABLE_1

 make the npc attackable?

rektbyfaith
Administrator
0
03-05-2016, 12:14 AM
#5
Archived author: Peacy • Posted: 2016-03-05T00:14:59+00:00
Original source

Anyone Know how to solve this issue?
rektbyfaith
03-05-2016, 12:14 AM #5

Archived author: Peacy • Posted: 2016-03-05T00:14:59+00:00
Original source

Anyone Know how to solve this issue?

rektbyfaith
Administrator
0
03-05-2016, 09:50 AM
#6
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);
rektbyfaith
03-05-2016, 09:50 AM #6

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);

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)