Jump to content

[implement] Arena points from Daily BG quests


Recommended Posts

Posted

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

since patch 3.3.0 daily battleground quests should reward players with arena points, this fix implemet it

For which repository revision was the patch created?

9245

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

maybe it is i wasnt looking for it

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

me

EDIT: i've rather put c++ part also on pastebin http://pastebin.com/m6de36633

rewarding arena points

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
-13286,10 +13286,14 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver

    // honor reward
    if (pQuest->GetRewHonorableKills())
        RewardHonor(NULL, 0, MaNGOS::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorableKills()));

+    // arena reward
+	if (pQuest->GetRewArenaPoints())
+		ModifyArenaPoints(pQuest->GetRewArenaPoints());
+	
    // title reward
    if (pQuest->GetCharTitleId())
    {
        if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(pQuest->GetCharTitleId()))
            SetTitle(titleEntry);

i implemet this as a new column in quest_template, here is sql

ALTER TABLE quest_template
 ADD COLUMN    RewArenaPoints           smallint(5) unsigned NOT NULL default '0' AFTER RewHonorableKills;

you may modify position of this column and you dont have to rewrite whole questdef.cpp as i did

i choose this way because i think is better to have it together with honor rewarding

anyway here is my way

diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -3391,19 +3391,19 @@ void ObjectMgr::LoadQuests()
        "RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6,"
    //   83          84          85          86          87             88             89             90
        "RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4,"
    //   91              92              93              94              95              96            97            98            99            100
        "RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5,"
-    //   101                102            103               104       105           106                107               108         109     110     111
-        "RewHonorableKills, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt,"
-    //   112            113            114            115            116                 117                 118                 119
+    //   101                102             103            104               105       106           107                108               109         110     111     112
+        "RewHonorableKills, RewArenaPoints, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt,"
+    //   113            114            115            116            117                 118                 119                 120
        "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4,"
-    //   120              121            122                123                124                125
+    //   121              122            123                124                125                126
        "IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4,"
-    //   126                     127                     128                     129
+    //   127                     128                     129                     130
        "OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4,"
-    //   130          131
+    //   131          132
        "StartScript, CompleteScript"
        " FROM quest_template");
    if(result == NULL)
    {
        barGoLink bar( 1 );

diff --git a/src/game/QuestDef.cpp b/src/game/QuestDef.cpp
--- a/src/game/QuestDef.cpp
+++ b/src/game/QuestDef.cpp
-99,38 +99,39 @@ Quest::Quest(Field * questRecord)

    for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
        RewRepValue[i] = questRecord[96+i].GetInt32();

    RewHonorableKills = questRecord[101].GetUInt32();
-    RewOrReqMoney = questRecord[102].GetInt32();
-    RewMoneyMaxLevel = questRecord[103].GetUInt32();
-    RewSpell = questRecord[104].GetUInt32();
-    RewSpellCast = questRecord[105].GetUInt32();
-    RewMailTemplateId = questRecord[106].GetUInt32();
-    RewMailDelaySecs = questRecord[107].GetUInt32();
-    PointMapId = questRecord[108].GetUInt32();
-    PointX = questRecord[109].GetFloat();
-    PointY = questRecord[110].GetFloat();
-    PointOpt = questRecord[111].GetUInt32();
+    RewArenaPoints = questRecord[102].GetUInt32();
+    RewOrReqMoney = questRecord[103].GetInt32();
+    RewMoneyMaxLevel = questRecord[104].GetUInt32();
+    RewSpell = questRecord[105].GetUInt32();
+    RewSpellCast = questRecord[106].GetUInt32();
+    RewMailTemplateId = questRecord[107].GetUInt32();
+    RewMailDelaySecs = questRecord[108].GetUInt32();
+    PointMapId = questRecord[109].GetUInt32();
+    PointX = questRecord[110].GetFloat();
+    PointY = questRecord[111].GetFloat();
+    PointOpt = questRecord[112].GetUInt32();

    for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
-        DetailsEmote[i] = questRecord[112+i].GetUInt32();
+        DetailsEmote[i] = questRecord[113+i].GetUInt32();

    for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
-        DetailsEmoteDelay[i] = questRecord[116+i].GetUInt32();
+        DetailsEmoteDelay[i] = questRecord[117+i].GetUInt32();

-    IncompleteEmote = questRecord[120].GetUInt32();
-    CompleteEmote = questRecord[121].GetUInt32();
+    IncompleteEmote = questRecord[121].GetUInt32();
+    CompleteEmote = questRecord[122].GetUInt32();

    for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
-        OfferRewardEmote[i] = questRecord[122+i].GetInt32();
+        OfferRewardEmote[i] = questRecord[123+i].GetInt32();

    for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
-        OfferRewardEmoteDelay[i] = questRecord[126+i].GetInt32();
+        OfferRewardEmoteDelay[i] = questRecord[127+i].GetInt32();

-    QuestStartScript = questRecord[130].GetUInt32();
-    QuestCompleteScript = questRecord[131].GetUInt32();
+    QuestStartScript = questRecord[131].GetUInt32();
+    QuestCompleteScript = questRecord[132].GetUInt32();

    QuestFlags |= SpecialFlags << 24;

    m_reqitemscount = 0;
    m_reqCreatureOrGOcount = 0;

diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h
--- a/src/game/QuestDef.h
+++ b/src/game/QuestDef.h
-212,10 +212,11 @@ class Quest
        std::string GetOfferRewardText() const { return OfferRewardText; }
        std::string GetRequestItemsText() const { return RequestItemsText; }
        std::string GetEndText() const { return EndText; }
        int32  GetRewOrReqMoney() const;
        uint32 GetRewHonorableKills() const { return RewHonorableKills; }
+	     uint32 GetRewArenaPoints() const { return RewArenaPoints; }
        uint32 GetRewMoneyMaxLevel() const { return RewMoneyMaxLevel; }
                                                            // use in XP calculation at client
        uint32 GetRewSpell() const { return RewSpell; }
        uint32 GetRewSpellCast() const { return RewSpellCast; }
        uint32 GetRewMailTemplateId() const { return RewMailTemplateId; }
-305,10 +306,11 @@ class Quest
        std::string Objectives;
        std::string OfferRewardText;
        std::string RequestItemsText;
        std::string EndText;
        uint32 RewHonorableKills;
+	     uint32 RewArenaPoints;
        int32  RewOrReqMoney;
        uint32 RewMoneyMaxLevel;
        uint32 RewSpell;
        uint32 RewSpellCast;
        uint32 RewMailTemplateId;

after this patch it will only reward arena points but it wont write a message into chat about it

then you can easily modify quests for example for ab

UPDATE quest_template SET RewArenaPoints = 15 WHERE entry IN (11335, 11339);

this adds arena points into quest log, quest taking and quest rewarding

diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp
--- a/src/gameGossipDef.cpp
+++ b/src/game/GossipDef.cpp
@@ -513,11 +513,11 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
    data << float(0);                                       // new 3.3.0
    data << uint32(pQuest->GetRewSpell());                  // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
    data << uint32(pQuest->GetRewSpellCast());              // casted spell
    data << uint32(pQuest->GetCharTitleId());               // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
    data << uint32(pQuest->GetBonusTalents());              // bonus talents
-    data << uint32(0);
+    data << uint32(pQuest->GetRewArenaPoints());
    data << uint32(0);

    for(int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
        data << uint32(0);

@@ -605,11 +605,11 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
    data << uint32(pQuest->GetSrcItemId());                 // source item id
    data << uint32(pQuest->GetFlags() & 0xFFFF);            // quest flags
    data << uint32(pQuest->GetCharTitleId());               // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
    data << uint32(pQuest->GetPlayersSlain());              // players slain
    data << uint32(pQuest->GetBonusTalents());              // bonus talents
-    data << uint32(0);                                      // bonus arena points
+    data << uint32(pQuest->GetRewArenaPoints());            // bonus arena points
    data << uint32(0);                                      // unknown

    int iI;

    if (pQuest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS))
@@ -763,11 +763,11 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID,
    data << uint32(0x08);                                   // unused by client?
    data << uint32(pQuest->GetRewSpell());                  // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
    data << uint32(pQuest->GetRewSpellCast());              // casted spell
    data << uint32(0);                                      // unknown
    data << uint32(pQuest->GetBonusTalents());              // bonus talents
-    data << uint32(0);
+    data << uint32(pQuest->GetRewArenaPoints());
    data << uint32(0);

    for(int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)        // reward factions ids
        data << uint32(0);

  • 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