cmangos / issues

This repository is used as a centralized point for all issues regarding CMaNGOS.
180 stars 47 forks source link

Trap GO behaviour is wrong when activated by spell or script #1343

Closed cala closed 6 years ago

cala commented 7 years ago

Current behavior: Some GO traps like Rookery Egg (175124) can be triggered by nearby player but also by spell cast by NPCs. When triggered by players, the animation is played, the trap spell is cast and the GO despawns. This is fine.

When triggered by spell with SPELL_EFFECT_ACTIVATE_OBJECT cast by a NPC, only the trap spell is cast. The animation is not played and the GO is not despawned. Activating the trap GO by DBScript ACTIVATE_OBJECT results in the same behaviour, if I recall correctly.

GO Traps should have the same behaviour whenever activated by nearby players or spell or script command.

Tagging @killerwife and @xfurry on this

Expected behavior: When triggered whenever by players, spell or command, the GO animation is played, the trap spell is cast and the GO despawns.

Steps to reproduce:

  1. In gm mode: .go object id 175124
  2. The trap GO will activate by playing its animation, casting spell 15745 (which summons Whelp (10161)) and the GO will despawn
  3. Summon NPC Solakar .npc add 10264 and engage him
  4. Solakar will periodically cast 16556 which activates GO 175124. The GO will indeed cast spell 15745 (which summons Whelp (10161)) but it will not despawn nor play its animation

Client version: Classic 1.12.1

Commit hash: https://github.com/cmangos/mangos-classic/commit/029748fbc9d86a62f6fdb396ea33f5e0722231e9

Database version: Classic DB version 1.8

Operating system: Mac OS X 10.6.8

killerwife commented 7 years ago

Well if it triggers trap at least, it means spell_script_target is set properly. The Spell effect works exactly like DBSCRIPT SCRIPT_COMMAND_ACTIVATE_OBJECT, since it essentially calls a c++ dbscript with delay. I am not aware of any subtleties in the code, but maybe something related to Faction or missing backport or some sort of broken logic on usage in GO. TBC branch seems to miss some wotlk GO stuff as well so I would not be surprised if there was some voodoo magic going on.

cala commented 7 years ago

Ok, I'll test the same GO on Classic, TBC and WotLK to see if at least they share the same behaviour. Or not.

cala commented 6 years ago

Closed by https://github.com/cmangos/mangos-classic/commit/3c1ef7353dbbd9a4c84f5aadbcdd4ef5f5b7eedf