From 59a84951da2bc5c29f238c65cca5c9618fe0ffc7 Mon Sep 17 00:00:00 2001 From: Dehravor Date: Fri, 25 Apr 2014 20:52:17 +0200 Subject: Core/Trade: Correction of distance checking --- src/server/game/Entities/Object/Object.h | 1 + src/server/game/Entities/Player/Player.cpp | 3 --- src/server/game/Handlers/TradeHandler.cpp | 9 ++++++++- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 208077e51cb..66cdd16bb6a 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -33,6 +33,7 @@ #define INTERACTION_DISTANCE 5.0f #define ATTACK_DISTANCE 5.0f #define INSPECT_DISTANCE 28.0f +#define TRADE_DISTANCE 11.11f #define MAX_VISIBILITY_DISTANCE SIZE_OF_GRIDS // max distance for visible objects #define SIGHT_RANGE_UNIT 50.0f #define DEFAULT_VISIBILITY_DISTANCE 90.0f // default visible distance, 90 yards on continents diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 94f212e6051..1c6c01270c1 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -6765,9 +6765,6 @@ bool Player::UpdatePosition(float x, float y, float z, float orientation, bool t if (GetGroup()) SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); - if (GetTrader() && !IsWithinDistInMap(GetTrader(), INTERACTION_DISTANCE)) - GetSession()->SendCancelTrade(); - CheckAreaExploreAndOutdoor(); return true; diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 28a511ad9d3..4372de9eafe 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -276,6 +276,13 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) // set before checks for propertly undo at problems (it already set in to client) my_trade->SetAccepted(true); + if (!_player->IsWithinDistInMap(trader, TRADE_DISTANCE, false)) + { + SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR); + my_trade->SetAccepted(false); + return; + } + // not accept case incorrect money amount if (!_player->HasEnoughMoney(my_trade->GetMoney())) { @@ -648,7 +655,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (!pOther->IsWithinDistInMap(_player, 10.0f, false)) + if (!pOther->IsWithinDistInMap(_player, TRADE_DISTANCE, false)) { SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR); return; -- cgit v1.2.3 From c20d0cb77e0bf1e8770856d2080205a1dc2e76fd Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Sun, 27 Apr 2014 02:23:33 +0300 Subject: Scripts/Sholazar Basin: Reconnaissance Flight (12671) Add workaround for the player/accessory mounting issue. Some small additions. Closes: 9443 --- sql/updates/world/2014_04_27_00_world_misc.sql | 24 ++++++++++++++++++++++ .../scripts/Northrend/zone_sholazar_basin.cpp | 8 ++++++++ 2 files changed, 32 insertions(+) create mode 100644 sql/updates/world/2014_04_27_00_world_misc.sql (limited to 'src') diff --git a/sql/updates/world/2014_04_27_00_world_misc.sql b/sql/updates/world/2014_04_27_00_world_misc.sql new file mode 100644 index 00000000000..4046efcc190 --- /dev/null +++ b/sql/updates/world/2014_04_27_00_world_misc.sql @@ -0,0 +1,24 @@ +-- Reconnaissance Flight (12671) +-- additions +SET @PLANE := 28710; -- Vic's Flying Machine +SET @SPELL_PLANE := 52256; -- Vic's Flying Machine Validate (must have condition to target player) +SET @SPELL_LAND := 52226; -- Land Flying Machine +SET @GOB_LANDING := 190708; -- Landing Pad Focus +SET @SPELL_AGGRO := 52259; -- Vic's Flying Machine Aggro Dummy +SET @NPC_SCREECHER := 28170; -- Frosthowl Screecher +SET @SPELL_SBOLT := 52257; -- Shadow Bolt + +UPDATE `creature_template` SET InhabitType='4' WHERE `entry`=@PLANE; +DELETE FROM `vehicle_template_accessory` WHERE `entry`=@PLANE; + +DELETE FROM `conditions` WHERE (`SourceEntry`=@SPELL_LAND AND `SourceTypeOrReferenceId`=17) OR (`SourceEntry` IN (@SPELL_AGGRO,@SPELL_SBOLT) AND `SourceTypeOrReferenceId`=13); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +-- because vehicles ignore spell focus we add an extra condition to fill in for this +(17,0,@SPELL_LAND,0,0,30,0,@GOB_LANDING,10,0,0,0,0,'','Requires Landing Pad Focus near to cast Land Flying Machine'), +(13,1,@SPELL_AGGRO,0,0,31,0,3,@NPC_SCREECHER,0,0,0,0,'','Vic''s Flying Machine Aggro Dummy to Frosthowl Screecher'), +(13,1,@SPELL_SBOLT,0,0,31,0,3,@PLANE,0,0,0,0,'','Shadow Bolt to Vic''s Flying Machine'); + +-- Frosthowl Screecher +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@NPC_SCREECHER; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@NPC_SCREECHER,0,0,0,0,0,100,0,0,0,3000,4000,11,52257,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Shadow Bolt'); diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 6e39d341c58..770a95c23d7 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -1021,7 +1021,14 @@ public: void PassengerBoarded(Unit* passenger, int8 /*seatId*/, bool apply) OVERRIDE { if (apply && passenger->GetTypeId() == TYPEID_PLAYER) + { + /// @workaround - Because accessory gets unmounted when using vehicle_template_accessory. + /// When vehicle spawns accessory is mounted to seat 0,but when player mounts + /// he uses the same seat (instead of mounting to seat 1) kicking the accessory out. + passenger->ChangeSeat(1, false); + me->GetVehicleKit()->InstallAccessory(NPC_PILOT, 0, true, TEMPSUMMON_DEAD_DESPAWN, 0); me->GetMotionMaster()->MovePath(NPC_PLANE, false); + } } void MovementInform(uint32 type, uint32 id) OVERRIDE @@ -1056,6 +1063,7 @@ public: case 25: Talk(PLANE_EMOTE); DoCast(SPELL_ENGINE); + me->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVEMENT); break; } } -- cgit v1.2.3 From eb722bf220c4b3550ce2f24ed065e6077035e962 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 27 Apr 2014 04:51:35 +0200 Subject: DB/Misc: Fix few typos --- src/server/game/Texts/CreatureTextMgr.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 77592ab4a8e..72aaa17394f 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -82,7 +82,7 @@ void CreatureTextMgr::LoadCreatureTexts() if (!result) { - TC_LOG_INFO("server.loading", ">> Loaded 0 ceature texts. DB table `creature_texts` is empty."); + TC_LOG_INFO("server.loading", ">> Loaded 0 ceature texts. DB table `creature_text` is empty."); return; } @@ -111,20 +111,20 @@ void CreatureTextMgr::LoadCreatureTexts() { if (!sSoundEntriesStore.LookupEntry(temp.sound)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound); temp.sound = 0; } } if (!GetLanguageDescByID(temp.lang)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang)); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang)); temp.lang = LANG_UNIVERSAL; } if (temp.type >= MAX_CHAT_MSG_TYPE) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type)); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type)); temp.type = CHAT_MSG_SAY; } @@ -132,7 +132,7 @@ void CreatureTextMgr::LoadCreatureTexts() { if (!sEmotesStore.LookupEntry(temp.emote)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote)); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote)); temp.emote = EMOTE_ONESHOT_NONE; } } @@ -141,7 +141,7 @@ void CreatureTextMgr::LoadCreatureTexts() { if (!sObjectMgr->GetBroadcastText(temp.BroadcastTextId)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u, Id %u in table `creature_texts` has non-existing or incompatible BroadcastTextId %u.", temp.entry, temp.group, temp.id, temp.BroadcastTextId); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u, Id %u in table `creature_text` has non-existing or incompatible BroadcastTextId %u.", temp.entry, temp.group, temp.id, temp.BroadcastTextId); temp.BroadcastTextId = 0; } } -- cgit v1.2.3