@@ -57,6 +57,9 @@ eventMgr(NULL),
57
57
58
58
ServerEventBindings(NULL ),
59
59
PlayerEventBindings(NULL ),
60
+ #if defined ELUNA_PLAYERBOTS
61
+ PlayerbotAIEventBindings (NULL ),
62
+ #endif
60
63
GuildEventBindings (NULL ),
61
64
GroupEventBindings(NULL ),
62
65
VehicleEventBindings(NULL ),
@@ -181,6 +184,9 @@ void Eluna::CreateBindStores()
181
184
182
185
ServerEventBindings = new BindingMap< EventKey<Hooks::ServerEvents> >(L);
183
186
PlayerEventBindings = new BindingMap< EventKey<Hooks::PlayerEvents> >(L);
187
+ #if defined ELUNA_PLAYERBOTS
188
+ PlayerbotAIEventBindings = new BindingMap< StringKey<Hooks::PlayerbotAIEvents> >(L);
189
+ #endif
184
190
GuildEventBindings = new BindingMap< EventKey<Hooks::GuildEvents> >(L);
185
191
GroupEventBindings = new BindingMap< EventKey<Hooks::GroupEvents> >(L);
186
192
VehicleEventBindings = new BindingMap< EventKey<Hooks::VehicleEvents> >(L);
@@ -205,6 +211,9 @@ void Eluna::DestroyBindStores()
205
211
{
206
212
delete ServerEventBindings;
207
213
delete PlayerEventBindings;
214
+ #if defined ELUNA_PLAYERBOTS
215
+ delete PlayerbotAIEventBindings;
216
+ #endif
208
217
delete GuildEventBindings;
209
218
delete GroupEventBindings;
210
219
delete VehicleEventBindings;
@@ -226,6 +235,9 @@ void Eluna::DestroyBindStores()
226
235
227
236
ServerEventBindings = NULL ;
228
237
PlayerEventBindings = NULL ;
238
+ #if defined ELUNA_PLAYERBOTS
239
+ PlayerbotAIEventBindings = NULL ;
240
+ #endif
229
241
GuildEventBindings = NULL ;
230
242
GroupEventBindings = NULL ;
231
243
VehicleEventBindings = NULL ;
@@ -732,7 +744,11 @@ static void createCancelCallback(Eluna* e, uint64 bindingID, BindingMap<K>* bind
732
744
}
733
745
734
746
// Saves the function reference ID given to the register type's store for given entry under the given event
735
- int Eluna::Register (uint8 regtype, uint32 entry, ObjectGuid guid, uint32 instanceId, uint32 event_id, int functionRef, uint32 shots)
747
+ int Eluna::Register (uint8 regtype, uint32 entry, ObjectGuid guid, uint32 instanceId, uint32 event_id, int functionRef, uint32 shots
748
+ #if defined ELUNA_PLAYERBOTS
749
+ , std::string qualifier
750
+ #endif
751
+ )
736
752
{
737
753
uint64 bindingID;
738
754
@@ -768,6 +784,18 @@ int Eluna::Register(uint8 regtype, uint32 entry, ObjectGuid guid, uint32 instanc
768
784
}
769
785
break ;
770
786
787
+ #if defined ELUNA_PLAYERBOTS
788
+ case Hooks::REGTYPE_PLAYERBOTAI:
789
+ if (event_id < Hooks::PLAYERBOTAI_EVENT_COUNT)
790
+ {
791
+ auto key = StringKey<Hooks::PlayerbotAIEvents>((Hooks::PlayerbotAIEvents)event_id, qualifier);
792
+ bindingID = PlayerbotAIEventBindings->Insert (key, functionRef, shots);
793
+ createCancelCallback (this , bindingID, PlayerbotAIEventBindings);
794
+ return 1 ; // Stack: callback
795
+ }
796
+ break ;
797
+ #endif
798
+
771
799
case Hooks::REGTYPE_GROUP:
772
800
if (event_id < Hooks::GROUP_EVENT_COUNT)
773
801
{
0 commit comments