@@ -767,28 +767,23 @@ class mod_zone_difficulty_rewardnpc : public CreatureScript
767
767
{
768
768
npcText = NPC_TEXT_DENIED;
769
769
SendGossipMenuFor (player, npcText, creature);
770
- std::string whisper;
771
- whisper.append (" I am sorry, time-traveler. This reward costs " );
772
- whisper.append (std::to_string (sZoneDifficulty ->TierRewards [category].Price ));
773
- whisper.append (" score but you only have " );
774
- whisper.append (std::to_string (availableScore));
775
- whisper.append (" " );
776
- whisper.append (sZoneDifficulty ->GetContentTypeString (category));
770
+ std::string whisper = Acore::StringFormat (" I am sorry, time-traveler. This reward costs {} score but you only have {} {}" ,
771
+ sZoneDifficulty ->TierRewards [category].Price ,
772
+ availableScore,
773
+ sZoneDifficulty ->GetContentTypeString (category));
774
+
777
775
creature->Whisper (whisper, LANG_UNIVERSAL, player);
778
776
return true ;
779
777
}
780
778
npcText = NPC_TEXT_CONFIRM;
781
779
ItemTemplate const * proto = sObjectMgr ->GetItemTemplate (sZoneDifficulty ->TierRewards [category].Entry );
782
- std::string gossip;
783
780
std::string name = proto->Name1 ;
784
781
785
782
if (ItemLocale const * leftIl = sObjectMgr ->GetItemLocale (sZoneDifficulty ->TierRewards [category].Entry ))
786
783
ObjectMgr::GetLocaleString (leftIl->Name , player->GetSession ()->GetSessionDbcLocale (), name);
787
784
788
- gossip.append (" Yes, " ).append (name).append (" is the item i want." );
789
785
AddGossipItemFor (player, GOSSIP_ICON_CHAT, " No!" , GOSSIP_SENDER_MAIN, 999998 );
790
- AddGossipItemFor (player, GOSSIP_ICON_VENDOR, gossip, GOSSIP_SENDER_MAIN, 99001000 + category);
791
- // LOG_INFO("module", "MOD-ZONE-DIFFICULTY: AddingGossipItem with action {}", 99001000 + category);
786
+ AddGossipItemFor (player, GOSSIP_ICON_VENDOR, Acore::StringFormat (" Yes, {} is the item I want." , name), GOSSIP_SENDER_MAIN, 99001000 + category);
792
787
SendGossipMenuFor (player, npcText, creature);
793
788
return true ;
794
789
}
@@ -800,24 +795,16 @@ class mod_zone_difficulty_rewardnpc : public CreatureScript
800
795
{
801
796
npcText = NPC_TEXT_CATEGORY;
802
797
if (sZoneDifficulty ->HasCompletedFullTier (action, player->GetGUID ().GetCounter ()))
803
- {
804
- std::string gossip = " I want to redeem the ultimate Mythicmode reward " ;
805
- gossip.append (sZoneDifficulty ->GetContentTypeString (action));
806
- AddGossipItemFor (player, GOSSIP_ICON_MONEY_BAG, gossip, GOSSIP_SENDER_MAIN, 99000000 + action);
807
- }
798
+ AddGossipItemFor (player, GOSSIP_ICON_MONEY_BAG, Acore::StringFormat (" I want to redeem the ultimate Mythicmode reward {}" , sZoneDifficulty ->GetContentTypeString (action)), GOSSIP_SENDER_MAIN, 99000000 + action);
808
799
809
800
uint32 i = 1 ;
810
801
for (auto & itemType : sZoneDifficulty ->Rewards [action])
811
802
{
812
- // LOG_INFO("module", "MOD-ZONE-DIFFICULTY: typedata.first is {}", itemType.first);
813
- std::string gossip;
814
803
std::string typestring = sZoneDifficulty ->GetItemTypeString (itemType.first );
815
804
if (sZoneDifficulty ->ItemIcons .find (i) != sZoneDifficulty ->ItemIcons .end ())
816
- {
817
- gossip.append (sZoneDifficulty ->ItemIcons [i]);
818
- }
819
- gossip.append (" I am interested in items from the " ).append (typestring).append (" category." );
820
- AddGossipItemFor (player, GOSSIP_ICON_CHAT, gossip, GOSSIP_SENDER_MAIN, itemType.first + (action * 100 ));
805
+ AddGossipItemFor (player, GOSSIP_ICON_CHAT, Acore::StringFormat (" {} I am interested in items from the {} category." , sZoneDifficulty ->ItemIcons [i], typestring), GOSSIP_SENDER_MAIN, itemType.first + (action * 100 ));
806
+ else
807
+ AddGossipItemFor (player, GOSSIP_ICON_CHAT, Acore::StringFormat (" I am interested in items from the {} category." , typestring), GOSSIP_SENDER_MAIN, itemType.first + (action * 100 ));
821
808
++i;
822
809
}
823
810
}
@@ -871,29 +858,23 @@ class mod_zone_difficulty_rewardnpc : public CreatureScript
871
858
{
872
859
npcText = NPC_TEXT_DENIED;
873
860
SendGossipMenuFor (player, npcText, creature);
874
- std::string whisper;
875
- whisper.append (" I am sorry, time-traveler. This item costs " );
876
- whisper.append (std::to_string (sZoneDifficulty ->Rewards [category][itemType][counter].Price ));
877
- whisper.append (" score but you only have " );
878
- whisper.append (std::to_string (sZoneDifficulty ->MythicmodeScore [category][player->GetGUID ().GetCounter ()]));
879
- whisper.append (" " );
880
- whisper.append (sZoneDifficulty ->GetContentTypeString (category));
861
+ std::string whisper = Acore::StringFormat (" I am sorry, time-traveler. This item costs {} but you only have {} {}" ,
862
+ sZoneDifficulty ->Rewards [category][itemType][counter].Price ,
863
+ sZoneDifficulty ->MythicmodeScore [category][player->GetGUID ().GetCounter ()],
864
+ sZoneDifficulty ->GetContentTypeString (category));
881
865
creature->Whisper (whisper, LANG_UNIVERSAL, player);
882
866
return true ;
883
867
}
884
868
885
869
npcText = NPC_TEXT_CONFIRM;
886
870
ItemTemplate const * proto = sObjectMgr ->GetItemTemplate (sZoneDifficulty ->Rewards [category][itemType][counter].Entry );
887
- std::string gossip;
888
871
std::string name = proto->Name1 ;
889
872
890
873
if (ItemLocale const * leftIl = sObjectMgr ->GetItemLocale (sZoneDifficulty ->Rewards [category][itemType][counter].Entry ))
891
874
ObjectMgr::GetLocaleString (leftIl->Name , player->GetSession ()->GetSessionDbcLocale (), name);
892
875
893
- gossip.append (" Yes, " ).append (name).append (" is the item i want." );
894
876
AddGossipItemFor (player, GOSSIP_ICON_CHAT, " No!" , GOSSIP_SENDER_MAIN, 999998 );
895
- AddGossipItemFor (player, GOSSIP_ICON_VENDOR, gossip, GOSSIP_SENDER_MAIN, 100000 + (1000 * category) + (100 * itemType) + counter);
896
- // LOG_INFO("module", "MOD-ZONE-DIFFICULTY: AddingGossipItem with action {}", 100000 + (1000 * category) + (100 * itemType) + counter);
877
+ AddGossipItemFor (player, GOSSIP_ICON_VENDOR, Acore::StringFormat (" Yes, {} is the item I want." , name), GOSSIP_SENDER_MAIN, 100000 + (1000 * category) + (100 * itemType) + counter);
897
878
}
898
879
else if (action > 100000 )
899
880
{
@@ -923,19 +904,14 @@ class mod_zone_difficulty_rewardnpc : public CreatureScript
923
904
return true ;
924
905
925
906
// Check if the player has the neccesary achievement
926
- if (sZoneDifficulty ->Rewards [category][itemType][counter].Achievement != 0 )
907
+ if (sZoneDifficulty ->Rewards [category][itemType][counter].Achievement )
927
908
{
928
909
if (!player->HasAchieved (sZoneDifficulty ->Rewards [category][itemType][counter].Achievement ))
929
910
{
930
911
std::string gossip = " You do not have the required achievement with ID " ;
931
912
gossip.append (std::to_string (sZoneDifficulty ->Rewards [category][itemType][counter].Achievement ));
932
913
gossip.append (" to receive this item. Before i can give it to you, you need to complete the whole dungeon where it can be obtained." );
933
914
creature->Whisper (gossip, LANG_UNIVERSAL, player);
934
- /* debug
935
- * LOG_INFO("module", "MOD-ZONE-DIFFICULTY: Player missing achiement with ID {} to obtain item with category {}, itemType {}, counter {}",
936
- * sZoneDifficulty->Rewards[category][itemType][counter].Achievement, category, itemType, counter);
937
- * end debug
938
- */
939
915
CloseGossipMenuFor (player);
940
916
return true ;
941
917
}
@@ -958,15 +934,10 @@ class mod_zone_difficulty_rewardnpc : public CreatureScript
958
934
959
935
for (auto & typedata : sZoneDifficulty ->Rewards )
960
936
{
961
- // LOG_INFO("module", "MOD-ZONE-DIFFICULTY: typedata.first is {}", typedata.first);
962
937
if (typedata.first != 0 )
963
938
{
964
- std::string gossip;
965
- std::string typestring = sZoneDifficulty ->GetContentTypeString (typedata.first );
966
- gossip.append (" I want to redeem rewards " ).append (typestring);
967
- // LOG_INFO("module", "MOD-ZONE-DIFFICULTY: typestring is: {} gossip is: {}", typestring, gossip);
968
939
// typedata.first is the ContentType
969
- AddGossipItemFor (player, GOSSIP_ICON_INTERACT_1, gossip , GOSSIP_SENDER_MAIN, typedata.first );
940
+ AddGossipItemFor (player, GOSSIP_ICON_INTERACT_1, Acore::StringFormat ( " I want to redeem rewards {} " , sZoneDifficulty -> GetContentTypeString (typedata. first )) , GOSSIP_SENDER_MAIN, typedata.first );
970
941
}
971
942
}
972
943
0 commit comments