From 70b558dd391d4b43b68bbc85a3149ad26b08403f Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Wed, 16 Nov 2011 21:02:37 +0100 Subject: Core/Units: Fix Unit::_IsValidAttackTarget (UNIT_FLAG_OOC_NOT_ATTACKABLE check specifically) Closes #3172 --- .../Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index 55211f3f047..dc2d34326a7 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -130,7 +130,7 @@ public: me->SetHealth(0); me->InterruptNonMeleeSpells(true); me->RemoveAllAuras(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->GetMotionMaster()->MovementExpired(false); me->GetMotionMaster()->MoveIdle(); me->SetStandState(UNIT_STAND_STATE_DEAD); @@ -152,7 +152,7 @@ public: { bIsUndead = true; bEventInProgress = false; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->UpdateEntry(MOB_INGVAR_UNDEAD); me->SetInCombatWith(me->getVictim()); me->GetMotionMaster()->MoveChase(me->getVictim()); -- cgit v1.2.3 From 831f2f4a9dedb6ca4ef422bd725ca7b95a2988c2 Mon Sep 17 00:00:00 2001 From: thumsoul Date: Sun, 20 Nov 2011 13:43:58 +0100 Subject: Core/Commands: Allow "$home" to be second parameter of .tele name, to teleport players to homebind Signed-off-by: Machiavelli --- sql/updates/world/2011_11_20_world_command.sql | 1 + src/server/scripts/Commands/cs_tele.cpp | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 sql/updates/world/2011_11_20_world_command.sql (limited to 'src/server/scripts') diff --git a/sql/updates/world/2011_11_20_world_command.sql b/sql/updates/world/2011_11_20_world_command.sql new file mode 100644 index 00000000000..ad276641f9b --- /dev/null +++ b/sql/updates/world/2011_11_20_world_command.sql @@ -0,0 +1 @@ +UPDATE `commands` SET `help`='Syntax: .tele name [#playername] #location\n\nTeleport the given character to a given location. Character can be offline.\n\nTo teleport to homebind, set #location to "$home" (without quotes).' WHERE `name` = 'tele name`; diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index 85e0ff2390b..9ee05361953 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -125,6 +125,29 @@ public: if (!handler->extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) return false; + if (strcmp(teleStr, "$home") == 0) // References target's homebind + { + if (target) + target->TeleportTo(target->m_homebindMapId, target->m_homebindX, target->m_homebindY, target->m_homebindZ, target->GetOrientation()); + else + { + QueryResult resultDB = CharacterDatabase.PQuery("SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = %u", target_guid); + if (resultDB) + { + Field* fieldsDB = resultDB->Fetch(); + uint32 mapId = fieldsDB[0].GetUInt32(); + uint32 zoneId = fieldsDB[1].GetUInt32(); + float posX = fieldsDB[2].GetFloat(); + float posY = fieldsDB[3].GetFloat(); + float posZ = fieldsDB[4].GetFloat(); + + Player::SavePositionInDB(mapId, posX, posY, posZ, 0, zoneId, target_guid); + } + } + + return true; + } + // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r GameTele const* tele = handler->extractGameTeleFromLink(teleStr); if (!tele) -- cgit v1.2.3 From 682c3289c71b4135c41f0fe6628f1b71bace47d2 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 20 Nov 2011 13:46:53 +0100 Subject: Tabs --- src/server/scripts/Commands/cs_tele.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index 9ee05361953..8bfa010463a 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -125,15 +125,15 @@ public: if (!handler->extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) return false; - if (strcmp(teleStr, "$home") == 0) // References target's homebind - { + if (strcmp(teleStr, "$home") == 0) // References target's homebind + { if (target) target->TeleportTo(target->m_homebindMapId, target->m_homebindX, target->m_homebindY, target->m_homebindZ, target->GetOrientation()); else - { + { QueryResult resultDB = CharacterDatabase.PQuery("SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = %u", target_guid); if (resultDB) - { + { Field* fieldsDB = resultDB->Fetch(); uint32 mapId = fieldsDB[0].GetUInt32(); uint32 zoneId = fieldsDB[1].GetUInt32(); -- cgit v1.2.3