-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[12683] Implement CreatureLinking Flag DESPAWN_ON_DESPAWN
Thanks to grz3s for testing and feedback.
- Loading branch information
1 parent
af0c505
commit e37d292
Showing
4 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,6 +262,7 @@ enum EventMask | |
EVENT_MASK_ON_DIE = FLAG_DESPAWN_ON_DEATH | FLAG_SELFKILL_ON_DEATH | FLAG_RESPAWN_ON_DEATH | FLAG_FOLLOW, | ||
EVENT_MASK_ON_RESPAWN = FLAG_RESPAWN_ON_RESPAWN | FLAG_DESPAWN_ON_RESPAWN | FLAG_FOLLOW, | ||
EVENT_MASK_TRIGGER_TO = FLAG_TO_AGGRO_ON_AGGRO | FLAG_TO_RESPAWN_ON_EVADE | FLAG_FOLLOW, | ||
EVENT_MASK_ON_DESPAWN = FLAG_DESPAWN_ON_DESPAWN, | ||
}; | ||
|
||
// This functions checks if the NPC has linked NPCs for dynamic action | ||
|
@@ -414,6 +415,7 @@ void CreatureLinkingHolder::DoCreatureLinkingEvent(CreatureLinkingEvent eventTyp | |
case LINKING_EVENT_EVADE: eventFlagFilter = EVENT_MASK_ON_EVADE; reverseEventFlagFilter = FLAG_TO_RESPAWN_ON_EVADE; break; | ||
case LINKING_EVENT_DIE: eventFlagFilter = EVENT_MASK_ON_DIE; reverseEventFlagFilter = 0; break; | ||
case LINKING_EVENT_RESPAWN: eventFlagFilter = EVENT_MASK_ON_RESPAWN; reverseEventFlagFilter = FLAG_FOLLOW; break; | ||
case LINKING_EVENT_DESPAWN: eventFlagFilter = EVENT_MASK_ON_DESPAWN; reverseEventFlagFilter = 0; break; | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Schmoozerd
Author
Member
|
||
|
||
// Process Slaves (by entry) | ||
|
@@ -471,6 +473,7 @@ void CreatureLinkingHolder::DoCreatureLinkingEvent(CreatureLinkingEvent eventTyp | |
SetFollowing(pSource, pMaster); | ||
break; | ||
case LINKING_EVENT_DIE: // Nothing linked for this case | ||
case LINKING_EVENT_DESPAWN: // Nothing linked for this case | ||
break; | ||
} | ||
} | ||
|
@@ -550,6 +553,11 @@ void CreatureLinkingHolder::ProcessSlave(CreatureLinkingEvent eventType, Creatur | |
if (flag & FLAG_FOLLOW && pSlave->isAlive() && !pSlave->isInCombat()) | ||
SetFollowing(pSlave, pSource); | ||
|
||
break; | ||
case LINKING_EVENT_DESPAWN: | ||
if (flag & FLAG_DESPAWN_ON_DESPAWN && !pSlave->IsDespawned()) | ||
pSlave->ForcedDespawn(); | ||
|
||
break; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#ifndef __REVISION_NR_H__ | ||
#define __REVISION_NR_H__ | ||
#define REVISION_NR "12682" | ||
#define REVISION_NR "12683" | ||
#endif // __REVISION_NR_H__ |
1 comment
on commit e37d292
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you
exactly ;)