From 5c8c458d60360a761f819c37e89ad1b86c7028cf Mon Sep 17 00:00:00 2001 From: therzok Date: Sat, 29 Dec 2012 21:14:12 +0200 Subject: *Fixing a typo. --- src/server/game/Entities/Creature/Creature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 650d904db47..d0ab5e78c97 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -908,7 +908,7 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const if (msg) { player->PlayerTalkClass->ClearMenus(); - switch (GetCreatureTemplate()->trainer_class) + switch (GetCreatureTemplate()->trainer_race) { case RACE_DWARF: player->PlayerTalkClass->SendGossipMenu(5865, GetGUID()); break; case RACE_GNOME: player->PlayerTalkClass->SendGossipMenu(4881, GetGUID()); break; -- cgit v1.2.3 From 3d3a8107e0d3509b6df35b26df914517ecee1938 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 29 Dec 2012 14:23:23 -0500 Subject: Core/Entities: Account for creatures that are spawned below ground level when adding flying flags. (Triggers, mostly) --- src/server/game/Entities/Creature/Creature.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index d0ab5e78c97..e069f5653c9 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -437,7 +437,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) float ground = GetPositionZ(); GetMap()->GetWaterOrGroundLevel(GetPositionX(), GetPositionY(), GetPositionZ(), &ground); - bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground); + bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground + 0.05f) || G3D::fuzzyLt(GetPositionZ(), ground - 0.05f); // Can be underground too, prevent the falling if (cInfo->InhabitType & INHABIT_AIR && cInfo->InhabitType & INHABIT_GROUND && isInAir) SetCanFly(true); @@ -482,7 +482,7 @@ void Creature::Update(uint32 diff) float ground = GetPositionZ(); GetMap()->GetWaterOrGroundLevel(GetPositionX(), GetPositionY(), GetPositionZ(), &ground); - bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground + 0.05f); + bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground + 0.05f) || G3D::fuzzyLt(GetPositionZ(), ground - 0.05f); // Can be underground too, prevent the falling CreatureTemplate const* cinfo = GetCreatureTemplate(); if (cinfo->InhabitType & INHABIT_AIR && cinfo->InhabitType & INHABIT_GROUND && isInAir) @@ -1574,7 +1574,7 @@ void Creature::setDeathState(DeathState s) float ground = GetPositionZ(); GetMap()->GetWaterOrGroundLevel(GetPositionX(), GetPositionY(), GetPositionZ(), &ground); - bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground); + bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground + 0.05f) || G3D::fuzzyLt(GetPositionZ(), ground - 0.05f); // Can be underground too, prevent the falling if (cinfo->InhabitType & INHABIT_AIR && cinfo->InhabitType & INHABIT_GROUND && isInAir) SetCanFly(true); -- cgit v1.2.3 From 9bc339cd890784d6aaa29f0bafb79bb8b3c6faaf Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 29 Dec 2012 15:25:48 -0500 Subject: Core/Movement: MSG_MOVE_TELEPORT is not supposed to be sent to the player being teleported. Thanks @vlad852 Closes #8798 Closes #8774 --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 62df8c2049c..2873cde3bae 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17344,7 +17344,7 @@ void Unit::SendTeleportPacket(Position& pos) Relocate(&oldPos); if (GetTypeId() == TYPEID_PLAYER) Relocate(&pos); - SendMessageToSet(&data2, true); + SendMessageToSet(&data2, false); } bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport) -- cgit v1.2.3 From 2002bc785e67d4b771b05d22c3290c67a32b2014 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 29 Dec 2012 15:35:56 -0500 Subject: Core/SAI: Fixed SMART_ACTION_SET_RANGED_MOVEMENT --- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 4e2c51e50c8..c4380d3586b 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -906,6 +906,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_SEND_TARGET_TO_TARGET: case SMART_ACTION_SET_HOME_POS: case SMART_ACTION_SET_HEALTH_REGEN: + case SMART_ACTION_SET_RANGED_MOVEMENT: break; default: sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id); -- cgit v1.2.3 From 609c5700d6c5edab16003a1dd0154c0a5cc0c78f Mon Sep 17 00:00:00 2001 From: Warpten Date: Sat, 29 Dec 2012 22:26:40 +0100 Subject: Core/SAI: SMART_ACTION_NONE is not a valid action. Also accept SMART_ACTION_SET_RANGED_MOVEMENT as a valid action. --- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index c4380d3586b..90d728abdb0 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -882,7 +882,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_RESET_SCRIPT_BASE_OBJECT: case SMART_ACTION_ACTIVATE_GOBJECT: case SMART_ACTION_CALL_SCRIPT_RESET: - case SMART_ACTION_NONE: + case SMART_ACTION_SET_RANGED_MOVEMENT: case SMART_ACTION_CALL_TIMED_ACTIONLIST: case SMART_ACTION_SET_NPC_FLAG: case SMART_ACTION_ADD_NPC_FLAG: -- cgit v1.2.3 From 63b9a7579cb0834e029b9ab1a189069e78d99562 Mon Sep 17 00:00:00 2001 From: Warpten Date: Sat, 29 Dec 2012 22:30:29 +0100 Subject: Core/SAI: Fixed build, i need new glasses. --- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 90d728abdb0..32c480d7c3c 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -906,7 +906,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_SEND_TARGET_TO_TARGET: case SMART_ACTION_SET_HOME_POS: case SMART_ACTION_SET_HEALTH_REGEN: - case SMART_ACTION_SET_RANGED_MOVEMENT: break; default: sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id); -- cgit v1.2.3 From 6edffb036d018c29f94e3817b905aa8fcd585aa8 Mon Sep 17 00:00:00 2001 From: Trista Date: Sun, 30 Dec 2012 01:06:55 +0200 Subject: Core/Vehicles: revert 95152d57539064d8278e323899290cba2fb2b0cd and 95152d57539064d8278e323899290cba2fb2b0cd Sorry about troubles caused, hed reason to think formula was wrong, but it wasn't. However there is part of the code that needs to be improved I describbed in this commit as TO DO: Connected with: #8195 --- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2873cde3bae..d052fe1bfb8 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17064,7 +17064,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) } if (IsInMap(caster)) - caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID); + caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId + 1, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID); else // This can happen during Player::_LoadAuras { int32 bp0 = seatId; @@ -17094,7 +17094,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) void Unit::EnterVehicle(Unit* base, int8 seatId) { - CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); + CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId + 1, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); } void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 131d84c7fc1..9f136d11b88 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -454,11 +454,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) // custom amount calculations go here switch (GetAuraType()) { - // Control vehicle auras should not get m_amount sum out of basepoints and DieSide calculated together, - // but only from basepoints. Only such aura case fow now so handle it here. case SPELL_AURA_CONTROL_VEHICLE: - m_amount = m_baseAmount; - break; // crowd control auras case SPELL_AURA_MOD_CONFUSE: case SPELL_AURA_MOD_FEAR: @@ -3204,7 +3200,12 @@ void AuraEffect::HandleAuraControlVehicle(AuraApplication const* aurApp, uint8 m if (apply) { - caster->_EnterVehicle(target->GetVehicleKit(), m_amount, aurApp); + // Currently spells that have base points 0 and DieSides 0 = "0/0" exception are pushed to -1, + // however the idea of 0/0 is to ingore flag VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT and -1 checks for it, + // so this break such spells or most of them. + // Current formula about m_amount: effect base points + dieside - 1 + // TO DO: Reasearch more about 0/0 and fix it. + caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp); } else { -- cgit v1.2.3 From 0aef9419b6939a92a6c64fb873bf3f7a4820088b Mon Sep 17 00:00:00 2001 From: Trista Date: Sun, 30 Dec 2012 01:34:53 +0200 Subject: Core/Vehicles: Missed change --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 9f136d11b88..dba318610c5 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -454,7 +454,6 @@ int32 AuraEffect::CalculateAmount(Unit* caster) // custom amount calculations go here switch (GetAuraType()) { - case SPELL_AURA_CONTROL_VEHICLE: // crowd control auras case SPELL_AURA_MOD_CONFUSE: case SPELL_AURA_MOD_FEAR: -- cgit v1.2.3 From b4be02c8a0f48b68b094a1bc00caabf1f4e06d05 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 30 Dec 2012 16:03:25 -0500 Subject: Core/Conditions: Rename CONDITION_INSTANCE_DATA to CONDITION_INSTANCE_INFO. And allow it to be used with GetData, GetData64 and GetBossState. --- src/server/game/Conditions/ConditionMgr.cpp | 26 +++++++++++++++++++++----- src/server/game/Conditions/ConditionMgr.h | 9 ++++++++- 2 files changed, 29 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 37835618183..f66783fb89a 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -154,11 +154,27 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) case CONDITION_ACTIVE_EVENT: condMeets = sGameEventMgr->IsActiveEvent(ConditionValue1); break; - case CONDITION_INSTANCE_DATA: + case CONDITION_INSTANCE_INFO: { Map* map = object->GetMap(); - if (map && map->IsDungeon() && ((InstanceMap*)map)->GetInstanceScript()) - condMeets = ((InstanceMap*)map)->GetInstanceScript()->GetData(ConditionValue1) == ConditionValue2; + if (map && map->IsDungeon()) + { + if (InstanceScript const* instance = ((InstanceMap*)map)->GetInstanceScript()) + { + switch (ConditionValue3) + { + case INSTANCE_INFO_DATA: + condMeets = instance->GetData(ConditionValue1) == ConditionValue2; + break; + case INSTANCE_INFO_DATA64: + condMeets = instance->GetData64(ConditionValue1) == ConditionValue2; + break; + case INSTANCE_INFO_BOSS_STATE: + condMeets = instance->GetBossState(ConditionValue1) == ConditionValue2; + break; + } + } + } break; } case CONDITION_MAPID: @@ -367,7 +383,7 @@ uint32 Condition::GetSearcherTypeMaskForCondition() case CONDITION_ACTIVE_EVENT: mask |= GRID_MAP_TYPE_MASK_ALL; break; - case CONDITION_INSTANCE_DATA: + case CONDITION_INSTANCE_INFO: mask |= GRID_MAP_TYPE_MASK_ALL; break; case CONDITION_MAPID: @@ -1899,7 +1915,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) break; } case CONDITION_AREAID: - case CONDITION_INSTANCE_DATA: + case CONDITION_INSTANCE_INFO: break; case CONDITION_WORLD_STATE: { diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 807b75c4ee6..520e786a66a 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -46,7 +46,7 @@ enum ConditionTypes CONDITION_DRUNKENSTATE = 10, // DrunkenState 0, 0 true if player is drunk enough CONDITION_WORLD_STATE = 11, // index value 0 true if world has the value for the index CONDITION_ACTIVE_EVENT = 12, // event_id 0 0 true if event is active - CONDITION_INSTANCE_DATA = 13, // entry data 0 true if data is set in current instance + CONDITION_INSTANCE_INFO = 13, // entry data type true if the instance info defined by type (enum InstanceInfo) equals data. CONDITION_QUEST_NONE = 14, // quest_id 0 0 true if doesn't have quest saved CONDITION_CLASS = 15, // class 0 0 true if player's class is equal to class CONDITION_RACE = 16, // race 0 0 true if player's race is equal to race @@ -152,6 +152,13 @@ enum RelationType RELATION_MAX }; +enum InstanceInfo +{ + INSTANCE_INFO_DATA = 0, + INSTANCE_INFO_DATA64, + INSTANCE_INFO_BOSS_STATE +}; + enum { MAX_CONDITION_TARGETS = 3 -- cgit v1.2.3 From edb90f957baa9d9bb83f4477954593117e9fa858 Mon Sep 17 00:00:00 2001 From: Gacko Date: Mon, 31 Dec 2012 15:03:19 +0100 Subject: Core/DB: Haaleshi Altar - Prevent crash due to spamming GossipHello - Convert core script to SAI - Solves #8220 --- sql/updates/world/2012_12_31_01_world_sai.sql | 13 +++++++++++++ src/server/scripts/Outland/hellfire_peninsula.cpp | 21 +-------------------- 2 files changed, 14 insertions(+), 20 deletions(-) create mode 100644 sql/updates/world/2012_12_31_01_world_sai.sql (limited to 'src') diff --git a/sql/updates/world/2012_12_31_01_world_sai.sql b/sql/updates/world/2012_12_31_01_world_sai.sql new file mode 100644 index 00000000000..96cf4d1e724 --- /dev/null +++ b/sql/updates/world/2012_12_31_01_world_sai.sql @@ -0,0 +1,13 @@ +-- Assign SmartGameObjectAI +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI',`ScriptName`='' WHERE `entry`=181606; + +-- SmartGameObjectAI for summoning Aeranas at Haaleshi Altar +DELETE FROM `smart_scripts` WHERE `entryorguid`=181606 AND `source_type`=1; +INSERT INTO `smart_scripts`(`entryorguid`,`source_type`,`id`,`event_type`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`target_type`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(181606,1,0,64,12,17085,4,60000,8,-1321.79,4043.8,116.24,1.25,'Haaleshi Altar - On gossip hello - Summon Aeranas'); + +-- Aeranas should only be summonened if there is not already one in range +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=181606 AND `SourceId`=1; +INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) VALUES +(22,1,181606,1,29,1,17085,50,1,'Haaleshi Altar - Only summon Aeranas if there is not already one in range'), +(22,1,181606,1,28,0,9418,0,0,'Haaleshi Altar - Only summon Aeranas if invoker has completed quest Avruus Orb (Is auto-completed)'); diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/hellfire_peninsula.cpp index 7ac90320347..24d00235ab8 100644 --- a/src/server/scripts/Outland/hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/hellfire_peninsula.cpp @@ -53,9 +53,7 @@ enum eAeranas FACTION_FRIENDLY = 35, SPELL_ENVELOPING_WINDS = 15535, - SPELL_SHOCK = 12553, - - C_AERANAS = 17085 + SPELL_SHOCK = 12553 }; class npc_aeranas : public CreatureScript @@ -204,22 +202,6 @@ public: }; }; -/*###### -## go_haaleshi_altar -######*/ - -class go_haaleshi_altar : public GameObjectScript -{ -public: - go_haaleshi_altar() : GameObjectScript("go_haaleshi_altar") { } - - bool OnGossipHello(Player* /*player*/, GameObject* go) - { - go->SummonCreature(C_AERANAS, -1321.79f, 4043.80f, 116.24f, 1.25f, TEMPSUMMON_TIMED_DESPAWN, 180000); - return false; - } -}; - /*###### ## npc_naladu ######*/ @@ -532,7 +514,6 @@ void AddSC_hellfire_peninsula() { new npc_aeranas(); new npc_ancestral_wolf(); - new go_haaleshi_altar(); new npc_naladu(); new npc_tracy_proudwell(); new npc_trollbane(); -- cgit v1.2.3