I currently trying to create a little mod. But I don't know how to :
1) detect the use of some spell. I know the spellid of each spell but I don't know if I must look for event (and which one) or look for conbat log (and how) ?
The spell are : Teleport: xxxxxx, Hearthstone, Engineer Transporter
2) detect using a taxi or more specificaly that I just stop using it :)
3) detect that I walk through a Portal (made by a Mage or one that is in shattrah)
4) detect that I accept being summon by a Warlock.
For a start, you can type /combatlog and start doing the above things, and see what the combat log file generates. Everything recorded in the file will be in COMBAT_LOG_EVENT_UNFILTERED as the arguments to that event.
Spells with a cast time do not actually fire a SPELL_CAST_SUCCESS event in the combat log, only the SPELL_CAST_START/STOP event, so you'll have to do some guessing as to whether the spell was successful.
For those events that don't use the combat log, I will advise looking in a similar addon to see how its detected. For example, InFlight would have methods to detect starting/stopping a flight in order to record the length of the flight.
Accepting a summon would probably be detecting that the Accept Summon button was pressed and checking StaticPopups.lua which dialog it is and which function is being called.
Walking through a mage/shattrath portal is undetectable by any means, apart from zone change events (ZONE_CHANGE_NEW_AREA or PLAYER_ENTERING_WORLD). You could teleport yourself 2 yards away to the teleport point and none of these events would fire.
UnitOnTaxi("player") will tell you if you are on a taxi.
TakeTaxiNode(node) is called when you get on the taxi.
The only way, that I know of, to tell when you stopped a flight is to put UnitOnTaxi("player") into an OnUpdate handler and call your TaxiStopped function when UnitOnTaxi("player") returns false or nil or whatever it is.
Ugh, don't tell people to hook and run OnUpdates unless you've investigated the events and found there are none...
UNIT_FLAGS fires when you take a taxi, just test UnitOnTaxi("player") when it fires. It probably fires on de-taxi as well, but I use PLAYER_CONTROL_GAINED to detect that.
For the spellcasts, just watch SPELLCAST_START, SPELLCAST_FAILED, SPELLCAST_INTERRUPTED, SPELLCAST_STOP. You can look for PLAYER_ENTERING_WORLD as well, but that only fires if the teleport results in a loading screen (hearthing across continents/BC zones). If STOP fires and FAILED/INTERRUPTED don't, then the spell was successful.
Ugh, don't tell people to hook and run OnUpdates unless you've investigated the events and found there are none...
UNIT_FLAGS fires when you take a taxi, just test UnitOnTaxi("player") when it fires. It probably fires on de-taxi as well, but I use PLAYER_CONTROL_GAINED to detect that.
For the spellcasts, just watch SPELLCAST_START, SPELLCAST_FAILED, SPELLCAST_INTERRUPTED, SPELLCAST_STOP. You can look for PLAYER_ENTERING_WORLD as well, but that only fires if the teleport results in a loading screen (hearthing across continents/BC zones). If STOP fires and FAILED/INTERRUPTED don't, then the spell was successful.
You expect me to know what the hell UNIT_FLAGS does? Especially with the *very* detailed description of it on WoWWiki. I investigated to the best of my ability and found no events that fire when taking a taxi.
I used to use FireShow back in the day to figure out what fired when but now I think Kyubi is used - there might be a more up to date version than the one linked on the files, and I'd hope someone would link that for you.
You expect me to know what the hell UNIT_FLAGS does? Especially with the *very* detailed description of it on WoWWiki. I investigated to the best of my ability and found no events that fire when taking a taxi.
WoWWiki shows this, I've never used it though.
"PLAYER_CONTROL_LOST"
Fires whenever the player is unable to control the character. Examples are when afflicted by fear or when using a taxi.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I currently trying to create a little mod. But I don't know how to :
1) detect the use of some spell. I know the spellid of each spell but I don't know if I must look for event (and which one) or look for conbat log (and how) ?
The spell are : Teleport: xxxxxx, Hearthstone, Engineer Transporter
2) detect using a taxi or more specificaly that I just stop using it :)
3) detect that I walk through a Portal (made by a Mage or one that is in shattrah)
4) detect that I accept being summon by a Warlock.
If some of you could help me ...
Regards,
Faerian
Spells with a cast time do not actually fire a SPELL_CAST_SUCCESS event in the combat log, only the SPELL_CAST_START/STOP event, so you'll have to do some guessing as to whether the spell was successful.
For those events that don't use the combat log, I will advise looking in a similar addon to see how its detected. For example, InFlight would have methods to detect starting/stopping a flight in order to record the length of the flight.
Accepting a summon would probably be detecting that the Accept Summon button was pressed and checking StaticPopups.lua which dialog it is and which function is being called.
Walking through a mage/shattrath portal is undetectable by any means, apart from zone change events (ZONE_CHANGE_NEW_AREA or PLAYER_ENTERING_WORLD). You could teleport yourself 2 yards away to the teleport point and none of these events would fire.
I'll try COMBAT_LOG_EVENT_UNFILTERED and look at InFlight for a first try :)
Regards,
TakeTaxiNode(node) is called when you get on the taxi.
The only way, that I know of, to tell when you stopped a flight is to put UnitOnTaxi("player") into an OnUpdate handler and call your TaxiStopped function when UnitOnTaxi("player") returns false or nil or whatever it is.
UNIT_FLAGS fires when you take a taxi, just test UnitOnTaxi("player") when it fires. It probably fires on de-taxi as well, but I use PLAYER_CONTROL_GAINED to detect that.
For the spellcasts, just watch SPELLCAST_START, SPELLCAST_FAILED, SPELLCAST_INTERRUPTED, SPELLCAST_STOP. You can look for PLAYER_ENTERING_WORLD as well, but that only fires if the teleport results in a loading screen (hearthing across continents/BC zones). If STOP fires and FAILED/INTERRUPTED don't, then the spell was successful.
WoWWiki shows this, I've never used it though.
"PLAYER_CONTROL_LOST"
Fires whenever the player is unable to control the character. Examples are when afflicted by fear or when using a taxi.