diff options
| author | tkrokli <tkrokli@hotmail.com> | 2015-10-09 04:46:58 +0200 | 
|---|---|---|
| committer | MitchesD <majklprofik@seznam.cz> | 2015-10-30 11:33:40 +0100 | 
| commit | 3d9b2d8de20650b6210d46d8110d9c730c1632f8 (patch) | |
| tree | ce743d3fd57ada88665ee555c92804f594f0e4e1 | |
| parent | 7504f75af7e40c43852d30193a670b358ea4eb15 (diff) | |
Core/Scripts: The Endless Hunger & Death's Challenge, creature text
This PR solves the following say text issues:
In quest ID 12733, Death's Challenge, the creature script npc_death_knight_initiate is supposed to target the player and refer to the player character's name in the following 2 lines from `creature_text`.`entry` 28406:
- "You don't stand a chance, $n." (`BroadcastTextId` 29267)
- "Remember this day, $n, for it is the day that you will be thoroughly owned." (`BroadcastTextId` 29270)
In quest ID 12848, The Endless Hunger, the creature script npc_unworthy_initiate is supposed to target the player and refer to the player character's race in the following 2 lines from `creature_text`.`entry` 29519, 29520, 29565, 29566 and 29567:
- "You are hopelessly outmatched, $r."  (`BroadcastTextId` 30212)
- "Sate your hunger on cold steel, $r!" (`BroadcastTextId` 30214)
The untargeted variables $r and $n appear in the say lines because the existing script assigns the text to the player character instead of the creatures. This does not produce any race or name information in /say or chat.
This Pull Request closes issue #14700 and replaces PR  #15678.
(cherry picked from commit 89107c3a8e61447fb6d34fd77fd454074ae5e064)
| -rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 31 | 
1 files changed, 15 insertions, 16 deletions
| diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 9b290852dc2..238ca194a65 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -93,11 +93,6 @@ class npc_unworthy_initiate : public CreatureScript  public:      npc_unworthy_initiate() : CreatureScript("npc_unworthy_initiate") { } -    CreatureAI* GetAI(Creature* creature) const override -    { -        return new npc_unworthy_initiateAI(creature); -    } -      struct npc_unworthy_initiateAI : public ScriptedAI      {          npc_unworthy_initiateAI(Creature* creature) : ScriptedAI(creature) @@ -156,7 +151,7 @@ public:                  me->CastSpell(me, SPELL_DK_INITIATE_VISUAL, true);                  if (Player* starter = ObjectAccessor::GetPlayer(*me, playerGUID)) -                    sCreatureTextMgr->SendChat(me, SAY_EVENT_ATTACK, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, starter); +                    Talk(SAY_EVENT_ATTACK, starter);                  phase = PHASE_TO_ATTACK;              } @@ -286,6 +281,11 @@ public:              }          }      }; + +    CreatureAI* GetAI(Creature* creature) const override +    { +        return new npc_unworthy_initiateAI(creature); +    }  };  class npc_unworthy_initiate_anchor : public CreatureScript @@ -460,6 +460,7 @@ enum Spells_DKI      //SPELL_DUEL_TRIGGERED        = 52990,      SPELL_DUEL_VICTORY          = 52994,      SPELL_DUEL_FLAG             = 52991, +    SPELL_GROVEL                = 7267,  };  enum Says_VBM @@ -497,8 +498,6 @@ public:              creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);              creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15); -            sCreatureTextMgr->SendChat(creature, SAY_DUEL, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player); -              player->CastSpell(creature, SPELL_DUEL, false);              player->CastSpell(player, SPELL_DUEL_FLAG, true);          } @@ -521,11 +520,6 @@ public:          return true;      } -    CreatureAI* GetAI(Creature* creature) const override -    { -        return new npc_death_knight_initiateAI(creature); -    } -      struct npc_death_knight_initiateAI : public CombatAI      {          npc_death_knight_initiateAI(Creature* creature) : CombatAI(creature) @@ -560,6 +554,7 @@ public:              if (!m_bIsDuelInProgress && pSpell->Id == SPELL_DUEL)              {                  m_uiDuelerGUID = pCaster->GetGUID(); +                Talk(SAY_DUEL, pCaster);                  m_bIsDuelInProgress = true;              }          } @@ -580,7 +575,7 @@ public:                          pDoneBy->AttackStop();                          me->CastSpell(pDoneBy, SPELL_DUEL_VICTORY, true);                          lose = true; -                        me->CastSpell(me, 7267, true); +                        me->CastSpell(me, SPELL_GROVEL, true);                          me->RestoreFaction();                      }                  } @@ -610,13 +605,13 @@ public:              {                  if (lose)                  { -                    if (!me->HasAura(7267)) +                    if (!me->HasAura(SPELL_GROVEL))                          EnterEvadeMode();                      return;                  }                  else if (me->GetVictim() && me->EnsureVictim()->GetTypeId() == TYPEID_PLAYER && me->EnsureVictim()->HealthBelowPct(10))                  { -                    me->EnsureVictim()->CastSpell(me->GetVictim(), 7267, true); // beg +                    me->EnsureVictim()->CastSpell(me->GetVictim(), SPELL_GROVEL, true); // beg                      me->EnsureVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true);                      EnterEvadeMode();                      return; @@ -629,6 +624,10 @@ public:          }      }; +    CreatureAI* GetAI(Creature* creature) const override +    { +        return new npc_death_knight_initiateAI(creature); +    }  };  /*###### | 
