From bc35a466e58ffd1dabe2fd54d538c55cb13de77c Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 19 Jan 2013 13:34:17 +0100 Subject: Core/Movement: Use a facing spline for chase movement --- .../game/Movement/MovementGenerators/TargetedMovementGenerator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index a1ac4ccb679..1958774380e 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -103,7 +103,6 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) return; */ - D::_addUnitStateMove(owner); i_targetReached = false; i_recalculateTravel = false; @@ -111,6 +110,11 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) Movement::MoveSplineInit init(owner); init.MoveTo(x, y, z); init.SetWalk(((D*)this)->EnableWalking()); + // Using the same condition for facing target as the one that is used for SetInFront on movement end + // - applies to ChaseMovementGenerator mostly + if (i_angle == 0.f) + init.SetFacing(i_target.getTarget()); + init.Launch(); } -- cgit v1.2.3 From a77bb44d1e2d114264184aa23ea18c8665ceb87b Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 19 Jan 2013 13:35:01 +0100 Subject: Core/RA: Warning fix --- src/server/worldserver/RemoteAccess/RASocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index 95fdad9ad44..e0f4e7f0de6 100644 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -71,7 +71,7 @@ int RASocket::send(const std::string& line) ssize_t n = peer().send(line.c_str(), line.length()); #endif // MSG_NOSIGNAL - return n == line.length() ? 0 : -1; + return n == ssize_t(line.length()) ? 0 : -1; } int RASocket::recv_line(ACE_Message_Block& buffer) -- cgit v1.2.3 From 0333c4ce8fb30133e14eae4d3fc9d5563d28ff6b Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 19 Jan 2013 18:19:30 +0100 Subject: Core/DataStores: Corrected reading CharStartOutfit.dbc --- src/server/game/DataStores/DBCStores.cpp | 13 +++++++++++++ src/server/game/DataStores/DBCStores.h | 2 ++ src/server/game/DataStores/DBCStructure.h | 14 +++++++------- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 3 +-- 6 files changed, 25 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 3fdff8e11d6..853ecb4e786 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -62,6 +62,7 @@ DBCStorage sBankBagSlotPricesStore(BankBagSlotPricesEnt DBCStorage sBattlemasterListStore(BattlemasterListEntryfmt); DBCStorage sBarberShopStyleStore(BarberShopStyleEntryfmt); DBCStorage sCharStartOutfitStore(CharStartOutfitEntryfmt); +std::map sCharStartOutfitMap; DBCStorage sCharTitlesStore(CharTitlesEntryfmt); DBCStorage sChatChannelsStore(ChatChannelsEntryfmt); DBCStorage sChrClassesStore(ChrClassesEntryfmt); @@ -284,6 +285,10 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sBattlemasterListStore, dbcPath, "BattlemasterList.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sBarberShopStyleStore, dbcPath, "BarberShopStyle.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sCharStartOutfitStore, dbcPath, "CharStartOutfit.dbc"); + for (uint32 i = 0; i < sCharStartOutfitStore.GetNumRows(); ++i) + if (CharStartOutfitEntry const* outfit = sCharStartOutfitStore.LookupEntry(i)) + sCharStartOutfitMap[outfit->Race | (outfit->Class << 8) | (outfit->Gender << 16)] = outfit; + LoadDBC(availableDbcLocales, bad_dbc_files, sCharTitlesStore, dbcPath, "CharTitles.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sChrClassesStore, dbcPath, "ChrClasses.dbc"); @@ -872,3 +877,11 @@ uint32 GetLiquidFlags(uint32 liquidType) return 0; } +CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender) +{ + std::map::const_iterator itr = sCharStartOutfitMap.find(race | (class_ << 8) | (gender << 16)); + if (itr == sCharStartOutfitMap.end()) + return NULL; + + return itr->second; +} diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index c77d0ee32f1..48a2cb3fe4e 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -65,6 +65,8 @@ uint32 GetLiquidFlags(uint32 liquidType); PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level); PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id); +CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender); + extern DBCStorage sAchievementStore; extern DBCStorage sAchievementCriteriaStore; extern DBCStorage sAreaStore;// recommend access using functions diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index aa19863ec29..529c84744bd 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -629,13 +629,13 @@ struct BattlemasterListEntry struct CharStartOutfitEntry { //uint32 Id; // 0 - uint32 RaceClassGender; // 1 (UNIT_FIELD_BYTES_0 & 0x00FFFFFF) comparable (0 byte = race, 1 byte = class, 2 byte = gender) - int32 ItemId[MAX_OUTFIT_ITEMS]; // 2-13 - //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 14-25 not required at server side - //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 26-37 not required at server side - //uint32 Unknown1; // 38, unique values (index-like with gaps ordered in other way as ids) - //uint32 Unknown2; // 39 - //uint32 Unknown3; // 40 + uint8 Race; // 1 + uint8 Class; // 2 + uint8 Gender; // 3 + //uint8 Unused; // 4 + int32 ItemId[MAX_OUTFIT_ITEMS]; // 5-28 + //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 29-52 not required at server side + //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 53-76 not required at server side }; struct CharTitlesEntry diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index b7d966757c8..c82fdf868b3 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -31,7 +31,7 @@ char const AuctionHouseEntryfmt[] = "niiixxxxxxxxxxxxxxxxx"; char const BankBagSlotPricesEntryfmt[] = "ni"; char const BarberShopStyleEntryfmt[] = "nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii"; char const BattlemasterListEntryfmt[] = "niiiiiiiiixssssssssssssssssxiixx"; -char const CharStartOutfitEntryfmt[] = "xniiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const CharStartOutfitEntryfmt[] = "dbbbXiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char const CharTitlesEntryfmt[] = "nxssssssssssssssssxxxxxxxxxxxxxxxxxxi"; char const ChatChannelsEntryfmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxx"; char const ChrClassesEntryfmt[] = "nxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7661053a0de..073fadde314 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1120,7 +1120,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) addActionButton(action_itr->button, action_itr->action, action_itr->type); // original items - if (CharStartOutfitEntry const* oEntry = sCharStartOutfitStore.LookupEntry(RaceClassGender)) + if (CharStartOutfitEntry const* oEntry = GetCharStartOutfitEntry(createInfo->Race, createInfo->Class, createInfo->Gender)) { for (int j = 0; j < MAX_OUTFIT_ITEMS; ++j) { diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 619d819bf9b..30257797470 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2956,10 +2956,9 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3 if (count < -1) sLog->outError(LOG_FILTER_SQL, "Invalid count %i specified on item %u be removed from original player create info (use -1)!", count, itemId); - uint32 RaceClass = (race_) | (class_ << 8); for (uint32 gender = 0; gender < GENDER_NONE; ++gender) { - if (CharStartOutfitEntry const* entry = sCharStartOutfitStore.LookupEntry(RaceClass | (gender << 16))) + if (CharStartOutfitEntry const* entry = GetCharStartOutfitEntry(race_, class_, gender)) { bool found = false; for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x) -- cgit v1.2.3 From ed44eea699379b4da814b85c22c0f87682cccc0c Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sat, 19 Jan 2013 20:28:29 +0100 Subject: Core: Fix warnings --- .../scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp | 4 ++-- .../scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp index 58e130ce644..19660cec4af 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp @@ -66,8 +66,8 @@ enum eMisc Position const PosMove[2] = { - { 299.4884f, 92.76137f, 105.6335f }, - { 314.8673f, 90.30210f, 101.6459f } + { 299.4884f, 92.76137f, 105.6335f, 0.0f }, + { 314.8673f, 90.30210f, 101.6459f, 0.0f } }; class boss_kirtonos_the_herald : public CreatureScript diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 7f8108e5e71..6039e01b901 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -359,7 +359,7 @@ class boss_halion : public CreatureScript if (Creature* twilightHalion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_TWILIGHT_HALION))) if (twilightHalion->isAlive()) twilightHalion->Kill(twilightHalion); - + if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HALION_CONTROLLER))) if (controller->isAlive()) controller->Kill(controller); -- cgit v1.2.3 From e524539d90f7c1b3393754641729fa844119b881 Mon Sep 17 00:00:00 2001 From: Gacko Date: Sat, 19 Jan 2013 19:17:31 +0100 Subject: Core/CS: More npcflag info in .npc info --- .../world/2013_01_19_06_world_trinity_string.sql | 28 ++++++++++++++ src/server/game/Miscellaneous/Language.h | 27 ++++++++++++- src/server/scripts/Commands/cs_npc.cpp | 44 +++++++++++++++++++--- 3 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 sql/updates/world/2013_01_19_06_world_trinity_string.sql (limited to 'src') diff --git a/sql/updates/world/2013_01_19_06_world_trinity_string.sql b/sql/updates/world/2013_01_19_06_world_trinity_string.sql new file mode 100644 index 00000000000..322d43a7720 --- /dev/null +++ b/sql/updates/world/2013_01_19_06_world_trinity_string.sql @@ -0,0 +1,28 @@ +DELETE FROM `trinity_string` WHERE `entry` BETWEEN 820 AND 842; +INSERT INTO `trinity_string`(`entry`,`content_default`) VALUES +(820,'* has gossip (%u)'), +(821,'* is quest giver (%u)'), +(822,'* is class trainer (%u)'), +(823,'* is profession trainer(%u)'), +(824,'* is ammo vendor (%u)'), +(825,'* is food vendor(%u)'), +(826,'* is poison vendor (%u)'), +(827,'* is reagent vendor (%u)'), +(828,'* can repair (%u)'), +(829,'* is flight master (%u)'), +(830,'* is spirit healer (%u)'), +(831,'* is spirit guide (%u)'), +(832,'* is innkeeper (%u)'), +(833,'* is banker (%u)'), +(834,'* is petitioner (%u)'), +(835,'* is tabard designer (%u)'), +(836,'* is battle master (%u)'), +(837,'* is auctioneer (%u)'), +(838,'* is stable master (%u)'), +(839,'* is guild banker (%u)'), +(840,'* has spell click (%u)'), +(841,'* is mailbox (%u)'), +(842,'* is player vehicle (%u)'); + +UPDATE `trinity_string` SET `content_default`='* is vendor (%u)' WHERE `entry`=545; +UPDATE `trinity_string` SET `content_default`='* is trainer (%u)' WHERE `entry`=546; diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 292833c3955..35b0a6f8569 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -742,7 +742,32 @@ enum TrinityStrings LANG_COMMAND_CREATURESTORAGE_NOTFOUND = 818, LANG_CHANNEL_CITY = 819, - // Room for in-game strings 820-999 not used + + LANG_NPCINFO_GOSSIP = 820, + LANG_NPCINFO_QUESTGIVER = 821, + LANG_NPCINFO_TRAINER_CLASS = 822, + LANG_NPCINFO_TRAINER_PROFESSION = 823, + LANG_NPCINFO_VENDOR_AMMO = 824, + LANG_NPCINFO_VENDOR_FOOD = 825, + LANG_NPCINFO_VENDOR_POISON = 826, + LANG_NPCINFO_VENDOR_REAGENT = 827, + LANG_NPCINFO_REPAIR = 828, + LANG_NPCINFO_FLIGHTMASTER = 829, + LANG_NPCINFO_SPIRITHEALER = 830, + LANG_NPCINFO_SPIRITGUIDE = 831, + LANG_NPCINFO_INNKEEPER = 832, + LANG_NPCINFO_BANKER = 833, + LANG_NPCINFO_PETITIONER = 834, + LANG_NPCINFO_TABARDDESIGNER = 835, + LANG_NPCINFO_BATTLEMASTER = 836, + LANG_NPCINFO_AUCTIONEER = 837, + LANG_NPCINFO_STABLEMASTER = 838, + LANG_NPCINFO_GUILD_BANKER = 839, + LANG_NPCINFO_SPELLCLICK = 840, + LANG_NPCINFO_MAILBOX = 841, + LANG_NPCINFO_PLAYER_VEHICLE = 842, + + // Room for in-game strings 843-999 not used // Level 4 (CLI only commands) LANG_COMMAND_EXIT = 1000, diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 8679e288282..7ccd5ed1177 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -33,6 +33,42 @@ EndScriptData */ #include "Player.h" #include "Pet.h" +struct NpcFlagText +{ + uint32 flag; + int32 text; +}; + +#define NPCFLAG_COUNT 24 + +const NpcFlagText npcFlagTexts[NPCFLAG_COUNT] = +{ + { UNIT_NPC_FLAG_AUCTIONEER, LANG_NPCINFO_AUCTIONEER }, + { UNIT_NPC_FLAG_BANKER, LANG_NPCINFO_BANKER }, + { UNIT_NPC_FLAG_BATTLEMASTER, LANG_NPCINFO_BATTLEMASTER }, + { UNIT_NPC_FLAG_FLIGHTMASTER, LANG_NPCINFO_FLIGHTMASTER }, + { UNIT_NPC_FLAG_GOSSIP, LANG_NPCINFO_GOSSIP }, + { UNIT_NPC_FLAG_GUILD_BANKER, LANG_NPCINFO_GUILD_BANKER }, + { UNIT_NPC_FLAG_INNKEEPER, LANG_NPCINFO_INNKEEPER }, + { UNIT_NPC_FLAG_PETITIONER, LANG_NPCINFO_PETITIONER }, + { UNIT_NPC_FLAG_PLAYER_VEHICLE, LANG_NPCINFO_PLAYER_VEHICLE }, + { UNIT_NPC_FLAG_QUESTGIVER, LANG_NPCINFO_QUESTGIVER }, + { UNIT_NPC_FLAG_REPAIR, LANG_NPCINFO_REPAIR }, + { UNIT_NPC_FLAG_SPELLCLICK, LANG_NPCINFO_SPELLCLICK }, + { UNIT_NPC_FLAG_SPIRITGUIDE, LANG_NPCINFO_SPIRITGUIDE }, + { UNIT_NPC_FLAG_SPIRITHEALER, LANG_NPCINFO_SPIRITHEALER }, + { UNIT_NPC_FLAG_STABLEMASTER, LANG_NPCINFO_STABLEMASTER }, + { UNIT_NPC_FLAG_TABARDDESIGNER, LANG_NPCINFO_TABARDDESIGNER }, + { UNIT_NPC_FLAG_TRAINER, LANG_NPCINFO_TRAINER }, + { UNIT_NPC_FLAG_TRAINER_CLASS, LANG_NPCINFO_TRAINER_CLASS }, + { UNIT_NPC_FLAG_TRAINER_PROFESSION, LANG_NPCINFO_TRAINER_PROFESSION }, + { UNIT_NPC_FLAG_VENDOR, LANG_NPCINFO_VENDOR }, + { UNIT_NPC_FLAG_VENDOR_AMMO, LANG_NPCINFO_VENDOR_AMMO }, + { UNIT_NPC_FLAG_VENDOR_FOOD, LANG_NPCINFO_VENDOR_FOOD }, + { UNIT_NPC_FLAG_VENDOR_POISON, LANG_NPCINFO_VENDOR_POISON }, + { UNIT_NPC_FLAG_VENDOR_REAGENT, LANG_NPCINFO_VENDOR_REAGENT } +}; + class npc_commandscript : public CommandScript { public: @@ -619,11 +655,9 @@ public: handler->PSendSysMessage(LANG_NPCINFO_POSITION, float(target->GetPositionX()), float(target->GetPositionY()), float(target->GetPositionZ())); handler->PSendSysMessage(LANG_NPCINFO_AIINFO, target->GetAIName().c_str(), target->GetScriptName().c_str()); - if (npcflags & UNIT_NPC_FLAG_VENDOR) - handler->SendSysMessage(LANG_NPCINFO_VENDOR); - - if (npcflags & UNIT_NPC_FLAG_TRAINER) - handler->SendSysMessage(LANG_NPCINFO_TRAINER); + for (uint8 i = 0; i < NPCFLAG_COUNT; i++) + if (npcflags & npcFlagTexts[i].flag) + handler->PSendSysMessage(npcFlagTexts[i].text, npcFlagTexts[i].flag); return true; } -- cgit v1.2.3