View Full Version : Some method questions

08-26-2014, 11:36 AM
I'd like to know the following things:

- How do you make a creature react completely passively? Making him stunned/pacified only removes melee, but not the combat animation. SetAllowedCombat seemed to work but a lot of times the boss cant get in combat anymore after that (even when setting it to true when leaving combat) probably because he's not in combat anymore after setting it to false so not sure how to set it to true then.

-The SetStandState() method, where can I find the ID's for the standing states?

- Is there any method to prevent spellcast interrupting (like a channeled spell) from another event? The way I did it before was once the channel started it cancelled the other spell event and made a replica of the other event that would get activated after the duration of the channel.

- Lastly a problem I've faced for a while that might be on my end in this case, though I never got a proper answer.. The vehicle methods. I tried some things but fucking around with this doesn't really get me anywhere. I simply want to know the exact method for adding passengers to a vehicle creature, if it doesn't work with my particular creatures then that's the end of that. I tried some things with GetVehicleKit(), a local variable to be able to refer to the passenger with GetNearestCreature() and AddPassenger() but getting errors.

Any help appreciated!

08-26-2014, 08:23 PM
1. The method "SetAllowCombat" is pretty self-explanatory. If it is false then you're obviously making it so the npc cannot go into combat since that's what it does. Making the NPC passive isn't hard at all, take the target dummy into account here. You can attack it, but it cannot attack back. I would say edit its flags but it seems you've had trouble with that. When it is stunned/pacified the combat animation should be suppressed seeing it isn't ready to attack yet. The only thing I see here is changing its react state to passive, like pets for example.


enum ReactStates

However, I don't think we even have React states in Eluna at the moment. I think what's holding us back is that cMangos classic has their ReactState in Unit CharmInfo and TC's is in Creature (not in CharmInfo), leaving us to add completely different methods just for them being so different. We could always add it to one emulator but not the other, however, that isn't the ideal thing to do. Creature inherits unit allowing it to access 'CharmInfo()->REACT_FUNCTIONS', but again, either way, it would be a bust.

2. You can search the source or if you have VS up, search for "SetStandState" -> Right Click -> Go To Definition and you should see the enumerator type "UnitStandStateType" -> Right Click -> Go To Definition. OR you can read this: It is in "Unit.h" under "enum UnitStandStateType (https://github.com/TrinityCore/TrinityCore/blob/master/src/server/game/Entities/Unit/Unit.h#L168-L180)". When Eluna is documented more, you will be able to go to Eluna's wiki to view all of this: "http://eluna.emudevs.com/"

3. I'm pretty sure there is, but I not sure of this. Perhaps someone can help you with this.

4. Ever since I added vehicles to Eluna they have always been a pain and buggy. However, that was awhile ago and they should work. I can't give any examples at the moment.