Jump to content

[patch] Implement MonsterSay target-support for Unit-targets


Schmoozerd

Recommended Posts

What bug does the patch fix? What features does the patch add?

* Implements functionality to actually use a (no player) target for MonsterSay (and similar)

I.e. $n will now work for Creature-Targets

* Remove old redundant Corpse::Say, Creature::Say, etc..

For which repository revision was the patch created?

- 10536, merges and compiles fine with 10637

- 10757 only rough tested (not tested yet with sd2 changes)

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

no

Who has been writing this patch? Please include either forum user names or email addresses.

me

Only rough tested! (Rev 10757)

Patch

http://paste2.org/p/1100350

or Incremental:

http://paste2.org/p/1100349 ( (1)remove obsolete code | (2)implement unit-target | (3)a bit cleanup related to the changes)

Remaining open:

Player::PlayerSay (etc) are quite similar, but they have a different Opcode, so I didn't touch them, but this could also be done..

(SD2-patch for testing)

http://paste2.org/p/981820

Old-Version

http://paste2.org/p/986157 (corrected typo found by NoFantasy) (10458)

http://paste2.org/p/992483 (10502)

http://paste2.org/p/1003469 (normal) - http://paste2.org/p/1003477(incremental)

Link to comment
Share on other sites

                   case CHAT_TYPE_WHISPER:
-                        if (!unit_target || !IS_PLAYER_GUID(unit_target))
+                        if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)


                    case CHAT_TYPE_BOSS_WHISPER:
-                        if (!unit_target || !IS_PLAYER_GUID(unit_target))
+                        if (!unitTarget || target->GetTypeId() != TYPEID_PLAYER)

Why are those different from each other?

Link to comment
Share on other sites

Maybe it's possible to implement through one function with enum param like MessageType?

Also, note that No-Fly Zone warning works through SMSG_MESSAGECHAT too. In this case sender = receiver and message type = 42.

S->C: SMSG_MESSAGECHAT (0x96) Size: 190
-----------------------------------------------------------------------------
Type: Raid Boss Whisper, Language: Universal
GUID: { 0x700000004271F20, Type: Player }
Unk: 0
Name: Character Name
Receiver GUID: { 0x700000004271F20, Type: Player }
Text Length: 137
Message: Предупреждение: вы вошли в зону, запрещенную для полетов, и будете спешены!
Chat tag: 0

Link to comment
Share on other sites

  • 2 months later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use