diff options
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 5 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_npc.cpp | 15 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_quest.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_wp.cpp | 4 |
5 files changed, 18 insertions, 10 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index d84cf140ac1..433e8e5a66b 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -481,7 +481,7 @@ public: char const* msg = "testtest"; uint8 type = atoi(args); WorldPacket data; - ChatHandler::FillMessageData(&data, handler->GetSession(), type, 0, "chan", handler->GetSession()->GetPlayer()->GetGUID(), msg, handler->GetSession()->GetPlayer()); + ChatHandler::BuildChatPacket(data, ChatMsg(type), LANG_UNIVERSAL, handler->GetSession()->GetPlayer(), handler->GetSession()->GetPlayer(), msg, 0, "chan"); handler->GetSession()->SendPacket(&data); return true; } @@ -1382,7 +1382,10 @@ public: } else { + Position pos; + transport->GetPosition(&pos); handler->PSendSysMessage("Transport %s is %s", transport->GetName().c_str(), transport->GetGoState() == GO_STATE_READY ? "stopped" : "moving"); + handler->PSendSysMessage("Transport position: %s", pos.ToString().c_str()); return true; } diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 06a97d91250..ce3f62e38dd 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -2280,7 +2280,7 @@ public: // stop combat + make player unattackable + duel stop + stop some spells player->setFaction(35); player->CombatStop(); - if (player->IsNonMeleeSpellCasted(true)) + if (player->IsNonMeleeSpellCast(true)) player->InterruptNonMeleeSpells(true); player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index b472ba48a5c..0306aed184d 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -275,7 +275,11 @@ public: uint32 db_guid = creature->GetDBTableGUIDLow(); - // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); + // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells() + // current "creature" variable is deleted and created fresh new, otherwise old values might trigger asserts or cause undefined behavior + creature->CleanupsBeforeDelete(); + delete creature; + creature = new Creature(); if (!creature->LoadCreatureFromDB(db_guid, map)) { delete creature; @@ -1204,7 +1208,7 @@ public: return false; } - creature->MonsterSay(args, LANG_UNIVERSAL, 0); + creature->MonsterSay(args, LANG_UNIVERSAL, NULL); // make some emotes char lastchar = args[strlen(args) - 1]; @@ -1291,10 +1295,11 @@ public: uint64 receiver_guid = atol(receiver_str); // check online security - if (handler->HasLowerSecurity(ObjectAccessor::FindPlayer(receiver_guid), 0)) + Player* receiver = ObjectAccessor::FindPlayer(receiver_guid); + if (handler->HasLowerSecurity(receiver, 0)) return false; - creature->MonsterWhisper(text, receiver_guid); + creature->MonsterWhisper(text, receiver); return true; } @@ -1311,7 +1316,7 @@ public: return false; } - creature->MonsterYell(args, LANG_UNIVERSAL, 0); + creature->MonsterYell(args, LANG_UNIVERSAL, NULL); // make an emote creature->HandleEmoteCommand(EMOTE_ONESHOT_SHOUT); diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 83e65d2f01f..cdae7a88387 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -201,7 +201,7 @@ public: } } - // All creature/GO slain/casted (not required, but otherwise it will display "Creature slain 0/10") + // All creature/GO slain/cast (not required, but otherwise it will display "Creature slain 0/10") for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) { int32 creature = quest->RequiredNpcOrGo[i]; diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index daa760c9c56..52a080ea16b 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -214,7 +214,7 @@ public: target->LoadPath(pathid); target->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); target->GetMotionMaster()->Initialize(); - target->MonsterSay("Path loaded.", 0, 0); + target->MonsterSay("Path loaded.", LANG_UNIVERSAL, NULL); return true; } @@ -270,7 +270,7 @@ public: target->SetDefaultMovementType(IDLE_MOTION_TYPE); target->GetMotionMaster()->MoveTargetedHome(); target->GetMotionMaster()->Initialize(); - target->MonsterSay("Path unloaded.", 0, 0); + target->MonsterSay("Path unloaded.", LANG_UNIVERSAL, NULL); return true; } handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path."); |
