From f8c01739dfef0bd30ed90f688ee97e84f0d700f7 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 27 Aug 2012 14:29:00 +0100 Subject: Scripts/Spells: Remove a not needed cast in spell_q12372_cast_from_gossip_trigger --- src/server/scripts/Spells/spell_quest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index fad1f6605be..637c9ae412e 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1261,9 +1261,9 @@ class spell_q12372_cast_from_gossip_trigger : public SpellScriptLoader void HandleScript(SpellEffIndex /*effIndex*/) { - Player* caster = GetCaster()->ToPlayer(); - caster->CastSpell(caster, SPELL_SUMMON_WYRMREST_DEFENDER, true); + GetCaster()->CastSpell(caster, SPELL_SUMMON_WYRMREST_DEFENDER, true); } + void Register() { OnEffectHitTarget += SpellEffectFn(spell_q12372_cast_from_gossip_trigger_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); -- cgit v1.2.3 From fc16106823dde9a3b38dec92b5122e56a55d64a0 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 27 Aug 2012 14:40:12 +0100 Subject: Scripts/Spells: Fix a typo in spell_q12372_cast_from_gossip_trigger and cleanup whitespace --- src/server/game/Battlefield/Battlefield.cpp | 6 +++--- src/server/game/Battlefield/Battlefield.h | 2 +- src/server/game/Battlefield/BattlefieldHandler.cpp | 6 +++--- src/server/game/Spells/SpellMgr.cpp | 4 ++-- src/server/game/World/World.cpp | 4 ++-- src/server/scripts/Northrend/dragonblight.cpp | 8 ++++---- src/server/scripts/Spells/spell_quest.cpp | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index f074975c6a5..7f701f541a1 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -65,7 +65,7 @@ Battlefield::~Battlefield() // Called when a player enters the zone void Battlefield::HandlePlayerEnterZone(Player* player, uint32 /*zone*/) { - // If battle is started, + // If battle is started, // If not full of players > invite player to join the war // If full of players > announce to player that BF is full and kick him after a few second if he desn't leave if (IsWarTime()) @@ -885,9 +885,9 @@ GuidSet::iterator BfCapturePoint::HandlePlayerLeave(Player* player) { if (m_capturePoint) player->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldState1, 0); - + GuidSet::iterator current = m_activePlayers[player->GetTeamId()].find(player->GetGUID()); - + if (current == m_activePlayers[player->GetTeamId()].end()) return current; // return end() diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h index 5fa8d6b1bc8..07daf33d431 100644 --- a/src/server/game/Battlefield/Battlefield.h +++ b/src/server/game/Battlefield/Battlefield.h @@ -35,7 +35,7 @@ enum BattlefieldTypes enum BattlefieldIDs { - BATTLEFIELD_BATTLEID_WG = 1, // Wintergrasp battle + BATTLEFIELD_BATTLEID_WG = 1, // Wintergrasp battle }; enum BattlefieldObjectiveStates diff --git a/src/server/game/Battlefield/BattlefieldHandler.cpp b/src/server/game/Battlefield/BattlefieldHandler.cpp index 09c6f18f796..b852082d582 100644 --- a/src/server/game/Battlefield/BattlefieldHandler.cpp +++ b/src/server/game/Battlefield/BattlefieldHandler.cpp @@ -32,7 +32,7 @@ //Param3:(time) Time in second that the player have for accept void WorldSession::SendBfInvitePlayerToWar(uint32 BattleId, uint32 ZoneId, uint32 p_time) { - //Send packet + //Send packet WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, 12); data << uint32(BattleId); data << uint32(ZoneId); @@ -65,13 +65,13 @@ void WorldSession::SendBfQueueInviteResponse(uint32 BattleId,uint32 ZoneId, bool WorldPacket data(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, 11); data << uint32(BattleId); data << uint32(ZoneId); - data << uint8((CanQueue ? 1 : 0)); //Accepted //0 you cannot queue wg //1 you are queued + data << uint8((CanQueue ? 1 : 0)); //Accepted //0 you cannot queue wg //1 you are queued data << uint8((Full ? 0 : 1)); //Logging In //0 wg full //1 queue for upcoming data << uint8(1); //Warmup SendPacket(&data); } -//This is call when player accept to join war +//This is call when player accept to join war //Param1:(BattleId) the BattleId of Bf void WorldSession::SendBfEntered(uint32 BattleId) { diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index b580c5e2282..e17e71f8869 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1160,7 +1160,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 // team that controls the workshop in the specified area uint32 team = bf->GetData(newArea); - + if (team == TEAM_HORDE) return spellId == 56618; else if (team == TEAM_ALLIANCE) @@ -1172,7 +1172,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 { if (!player) return false; - + if (Battlefield* battlefieldWG = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG)) return battlefieldWG->IsEnabled() && (player->GetTeamId() == battlefieldWG->GetDefenderTeam()) && !battlefieldWG->IsWarTime(); break; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 9814ddf57ad..ea74b6d06dd 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1209,7 +1209,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_WINTERGRASP_BATTLETIME] = ConfigMgr::GetIntDefault("Wintergrasp.BattleTimer", 30); m_int_configs[CONFIG_WINTERGRASP_NOBATTLETIME] = ConfigMgr::GetIntDefault("Wintergrasp.NoBattleTimer", 150); m_int_configs[CONFIG_WINTERGRASP_RESTART_AFTER_CRASH] = ConfigMgr::GetIntDefault("Wintergrasp.CrashRestartTimer", 10); - + if (reload) sScriptMgr->OnConfigLoad(reload); } @@ -1733,7 +1733,7 @@ void World::SetInitialWorldSettings() ///- Initialize Battlefield sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting Battlefield System"); sBattlefieldMgr->InitBattlefield(); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Transports..."); sMapMgr->LoadTransports(); diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp index fa64e350e36..3edc73fa68b 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/dragonblight.cpp @@ -185,15 +185,15 @@ class npc_wyrmrest_defender : public CreatureScript { public: npc_wyrmrest_defender() : CreatureScript("npc_wyrmrest_defender") { } - + bool OnGossipHello(Player* player, Creature* creature) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - + return true; } - + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) { player->PlayerTalkClass->ClearMenus(); @@ -203,7 +203,7 @@ class npc_wyrmrest_defender : public CreatureScript //Makes player cast trigger spell for 49207 on self player->CastSpell(player, SPELL_CHARACTER_SCRIPT, true); } - + return true; } }; diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 637c9ae412e..8b67a52d300 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1261,7 +1261,7 @@ class spell_q12372_cast_from_gossip_trigger : public SpellScriptLoader void HandleScript(SpellEffIndex /*effIndex*/) { - GetCaster()->CastSpell(caster, SPELL_SUMMON_WYRMREST_DEFENDER, true); + GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_WYRMREST_DEFENDER, true); } void Register() -- cgit v1.2.3 From 9776f6d681b6c5d8a61be34698d4bfc9c6a1b7d5 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 27 Aug 2012 10:33:05 -0400 Subject: Core/Wintergrasp: if wintergrasp is disabled make the last door auto trigger. --- src/server/game/Battlefield/Zones/BattlefieldWG.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/server') diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 39beb0265c7..70e2f4f1d93 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -176,6 +176,8 @@ bool BattlefieldWG::SetupBattlefield() for (uint8 i = 0; i < WG_MAX_OBJ; i++) { GameObject* go = SpawnGameObject(WGGameObjectBuilding[i].entry, WGGameObjectBuilding[i].x, WGGameObjectBuilding[i].y, WGGameObjectBuilding[i].z, WGGameObjectBuilding[i].o); + if (!m_IsEnabled && go->GetGOData()->id == 191810) + go->SwitchDoorOrButton(true); BfWGGameObjectBuilding* b = new BfWGGameObjectBuilding(this); b->Init(go, WGGameObjectBuilding[i].type, WGGameObjectBuilding[i].WorldState, WGGameObjectBuilding[i].nameId); BuildingsInZone.insert(b); -- cgit v1.2.3 From 7b11decc2615160590da36f93eeb9c6a3b4d8e80 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 27 Aug 2012 10:42:34 -0400 Subject: Core/Wintergrasp: cleanup some magic numbers and set the destructable state of the final gate to destroyed. --- src/server/game/Battlefield/Zones/BattlefieldWG.cpp | 4 ++-- src/server/game/Battlefield/Zones/BattlefieldWG.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 70e2f4f1d93..696d5309e92 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -176,8 +176,8 @@ bool BattlefieldWG::SetupBattlefield() for (uint8 i = 0; i < WG_MAX_OBJ; i++) { GameObject* go = SpawnGameObject(WGGameObjectBuilding[i].entry, WGGameObjectBuilding[i].x, WGGameObjectBuilding[i].y, WGGameObjectBuilding[i].z, WGGameObjectBuilding[i].o); - if (!m_IsEnabled && go->GetGOData()->id == 191810) - go->SwitchDoorOrButton(true); + if (!m_IsEnabled && go->GetGOData()->id == GO_WINTERGRASP_VAULT_GATE) + go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); BfWGGameObjectBuilding* b = new BfWGGameObjectBuilding(this); b->Init(go, WGGameObjectBuilding[i].type, WGGameObjectBuilding[i].WorldState, WGGameObjectBuilding[i].nameId); BuildingsInZone.insert(b); diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 5e868b29619..462ad87fbc8 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -540,6 +540,10 @@ enum WintergraspGameObject GO_WINTERGRASP_SHADOWSIGHT_TOWER = 190356, GO_WINTERGRASP_WINTER_S_EDGE_TOWER = 190357, GO_WINTERGRASP_FLAMEWATCH_TOWER = 190358, + + GO_WINTERGRASP_FORTRESS_GATE = 190375, + GO_WINTERGRASP_VAULT_GATE = 191810, + }; struct WintergraspObjectPositionData @@ -610,10 +614,10 @@ const WintergraspBuildingSpawnData WGGameObjectBuilding[WG_MAX_OBJ] = { 190358, 3706, 4459.1f, 1944.33f, 434.991f, -2.00276f, BATTLEFIELD_WG_OBJECTTYPE_TOWER, BATTLEFIELD_WG_TEXT_TOWER_NAME_E }, // Door of forteress (Not spawned in db) - { 190375, 3763, 5162.99f, 2841.23f, 410.162f, -3.13286f, BATTLEFIELD_WG_OBJECTTYPE_DOOR, 0 }, + { GO_WINTERGRASP_FORTRESS_GATE, 3763, 5162.99f, 2841.23f, 410.162f, -3.13286f, BATTLEFIELD_WG_OBJECTTYPE_DOOR, 0 }, // Last door (Not spawned in db) - { 191810, 3773, 5397.11f, 2841.54f, 425.899f, 3.14159f, BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST, 0 }, + { GO_WINTERGRASP_VAULT_GATE, 3773, 5397.11f, 2841.54f, 425.899f, 3.14159f, BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST, 0 }, }; -- cgit v1.2.3 From a086a8bd55f3bdc9ab26987bf8271c5f4e3e5d89 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 27 Aug 2012 10:45:02 -0400 Subject: Core/Wintergrasp: Move previous commit to the correct position --- src/server/game/Battlefield/Zones/BattlefieldWG.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 696d5309e92..d29ab32a3ae 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -176,10 +176,10 @@ bool BattlefieldWG::SetupBattlefield() for (uint8 i = 0; i < WG_MAX_OBJ; i++) { GameObject* go = SpawnGameObject(WGGameObjectBuilding[i].entry, WGGameObjectBuilding[i].x, WGGameObjectBuilding[i].y, WGGameObjectBuilding[i].z, WGGameObjectBuilding[i].o); - if (!m_IsEnabled && go->GetGOData()->id == GO_WINTERGRASP_VAULT_GATE) - go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); BfWGGameObjectBuilding* b = new BfWGGameObjectBuilding(this); b->Init(go, WGGameObjectBuilding[i].type, WGGameObjectBuilding[i].WorldState, WGGameObjectBuilding[i].nameId); + if (!m_IsEnabled && go->GetGOData()->id == GO_WINTERGRASP_VAULT_GATE) + go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); BuildingsInZone.insert(b); } -- cgit v1.2.3 From 59aeef8278b4ca3a4c326913aa0d6ecb55183432 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 27 Aug 2012 11:00:30 -0400 Subject: Scripts/Wintergrasp: fix grab passenger spell. --- src/server/scripts/Northrend/wintergrasp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server') diff --git a/src/server/scripts/Northrend/wintergrasp.cpp b/src/server/scripts/Northrend/wintergrasp.cpp index 5923cfadec7..59e9a31c4cf 100644 --- a/src/server/scripts/Northrend/wintergrasp.cpp +++ b/src/server/scripts/Northrend/wintergrasp.cpp @@ -502,7 +502,7 @@ class spell_wintergrasp_grab_passenger : public SpellScriptLoader void HandleScript(SpellEffIndex /*effIndex*/) { if (Player* target = GetHitPlayer()) - target->CastSpell(GetCaster(), SPELL_RIDE_WG_VEHICLE, true); + target->CastSpell(GetCaster(), SPELL_RIDE_WG_VEHICLE, false); } void Register() -- cgit v1.2.3 From 695e64556f470efff3db6911a774f208bfd271a0 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Mon, 27 Aug 2012 17:02:38 +0200 Subject: Core: Fix warnings and code style --- src/server/scripts/Northrend/dragonblight.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/server') diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp index 3edc73fa68b..b915f4c6304 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/dragonblight.cpp @@ -79,16 +79,16 @@ public: enum StrengthenAncientsMisc { - SAY_WALKER_FRIENDLY = 0, - SAY_WALKER_ENEMY = 1, - SAY_LOTHALOR = 0, + SAY_WALKER_FRIENDLY = 0, + SAY_WALKER_ENEMY = 1, + SAY_LOTHALOR = 0, - SPELL_CREATE_ITEM_BARK = 47550, - SPELL_CONFUSED = 47044, + SPELL_CREATE_ITEM_BARK = 47550, + SPELL_CONFUSED = 47044, - NPC_LOTHALOR = 26321, + NPC_LOTHALOR = 26321, - FACTION_WALKER_ENEMY = 14, + FACTION_WALKER_ENEMY = 14, }; class spell_q12096_q12092_dummy : public SpellScriptLoader // Strengthen the Ancients: On Interact Dummy to Woodlands Walker @@ -194,13 +194,13 @@ class npc_wyrmrest_defender : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); - //Makes player cast trigger spell for 49207 on self + // Makes player cast trigger spell for 49207 on self player->CastSpell(player, SPELL_CHARACTER_SCRIPT, true); } -- cgit v1.2.3 From b0256c30a465d190a034f637343a84766d8406ad Mon Sep 17 00:00:00 2001 From: neuro_999 Date: Mon, 27 Aug 2012 16:26:22 +0100 Subject: Scripts/Uldaman: Archaedas now Awaken his minnions & spawn of npc lore keeper of norgannon Closes #765 --- sql/updates/world/2012_08_27_02_world_creature.sql | 4 ++++ .../scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp | 13 ++++++++----- .../scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp | 3 +++ 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 sql/updates/world/2012_08_27_02_world_creature.sql (limited to 'src/server') diff --git a/sql/updates/world/2012_08_27_02_world_creature.sql b/sql/updates/world/2012_08_27_02_world_creature.sql new file mode 100644 index 00000000000..3595ea7b576 --- /dev/null +++ b/sql/updates/world/2012_08_27_02_world_creature.sql @@ -0,0 +1,4 @@ +SET @GUID = 42638; -- Set by TDB team (need X) +DELETE FROM `creature` WHERE `guid`=@GUID AND `id`=7172; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES +(@GUID,7172,70,1,1,0,0,150.466,306.014,-49.543,5.2359,300,0,0,1,0,0,0,0,0); diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 3ffb873e4d2..74fad4f94d8 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -95,14 +95,17 @@ class boss_archaedas : public CreatureScript me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); } - void ActivateMinion(uint64 uiGuid, bool bFlag) + void ActivateMinion(uint64 uiGuid, bool flag) { - Unit* pMinion = Unit::GetUnit(*me, uiGuid); + Unit* minion = Unit::GetUnit(*me, uiGuid); - if (pMinion && pMinion->isAlive()) + if (minion && minion->isAlive()) { - DoCast(pMinion, SPELL_AWAKEN_VAULT_WALKER, bFlag); - pMinion->CastSpell(pMinion, SPELL_ARCHAEDAS_AWAKEN, true); + DoCast(minion, SPELL_AWAKEN_VAULT_WALKER, flag); + minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN, true); + minion->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + minion->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); + minion->setFaction(14); } } diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp index ade07039a23..ee82da668f8 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -202,6 +202,9 @@ class instance_uldaman : public InstanceMapScript continue; archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true); target->CastSpell(target, SPELL_ARCHAEDAS_AWAKEN, true); + target->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); + target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + target->setFaction(14); return; // only want the first one we find } } -- cgit v1.2.3 From 1a0a80bb773d9ef492450aeba688a765d0077c7d Mon Sep 17 00:00:00 2001 From: gecko32 Date: Mon, 27 Aug 2012 16:50:47 +0100 Subject: Scripts/ZulGurub: Fix attacking Bloodlord Mandokir Closes #1007 Closes #7499 --- .../EasternKingdoms/ZulGurub/boss_mandokir.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/server') diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 83cd0b46fb8..32831eb047b 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -45,6 +45,8 @@ EndScriptData */ //Ohgans Spells #define SPELL_SUNDERARMOR 24317 +#define NPC_SPEAKER 11391 + class boss_mandokir : public CreatureScript { public: @@ -79,6 +81,7 @@ class boss_mandokir : public CreatureScript bool someWatched; bool RaptorDead; bool CombatStart; + bool SpeakerDead; uint64 WatchTarget; @@ -103,6 +106,7 @@ class boss_mandokir : public CreatureScript endWatch = false; RaptorDead = false; CombatStart = false; + SpeakerDead = false; DoCast(me, 23243); } @@ -129,19 +133,31 @@ class boss_mandokir : public CreatureScript } } } - DoCast(me, SPELL_LEVEL_UP, true); - KillCount = 0; + DoCast(me, SPELL_LEVEL_UP, true); + KillCount = 0; } } } void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + DoScriptText(SAY_AGGRO, me); } void UpdateAI(const uint32 diff) { + if (!SpeakerDead) + { + if (!me->FindNearestCreature(NPC_SPEAKER, 100.0f, true)) + { + me->GetMotionMaster()->MovePoint(0, -12196.3f, -1948.37f, 130.36f); + SpeakerDead = true; + } + } + + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && SpeakerDead) + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + if (!UpdateVictim()) return; -- cgit v1.2.3 From ccb20a1947d86285c757ce3ef7dbcdf7efb32458 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Mon, 27 Aug 2012 18:17:34 +0200 Subject: Core/Spells: Fix Pick Lock calculation Closes: #4323 --- src/server/game/Spells/Spell.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6376ff6e50b..90ac5ed5a3f 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6826,9 +6826,9 @@ SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& sk 0 : m_caster->ToPlayer()->GetSkillValue(skillId); // skill bonus provided by casting spell (mostly item spells) - // add the damage modifier from the spell casted (cheat lock / skeleton key etc.) + // add the effect base points modifier from the spell casted (cheat lock / skeleton key etc.) if (m_spellInfo->Effects[effIndex].TargetA.GetTarget() == TARGET_GAMEOBJECT_ITEM_TARGET || m_spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_GAMEOBJECT_ITEM_TARGET) - skillValue += uint32(CalculateDamage(effIndex, NULL)); + skillValue += m_spellInfo->Effects[effIndex].CalcValue(); if (skillValue < reqSkillValue) return SPELL_FAILED_LOW_CASTLEVEL; -- cgit v1.2.3 From 31dd9de0680dab9dad4f10f45c57db8bbeab1733 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 27 Aug 2012 12:30:03 -0400 Subject: Core/Wintergrasp: fix possible crash on startup --- src/server/game/Battlefield/Zones/BattlefieldWG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server') diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index d29ab32a3ae..6d2d823e341 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -178,7 +178,7 @@ bool BattlefieldWG::SetupBattlefield() GameObject* go = SpawnGameObject(WGGameObjectBuilding[i].entry, WGGameObjectBuilding[i].x, WGGameObjectBuilding[i].y, WGGameObjectBuilding[i].z, WGGameObjectBuilding[i].o); BfWGGameObjectBuilding* b = new BfWGGameObjectBuilding(this); b->Init(go, WGGameObjectBuilding[i].type, WGGameObjectBuilding[i].WorldState, WGGameObjectBuilding[i].nameId); - if (!m_IsEnabled && go->GetGOData()->id == GO_WINTERGRASP_VAULT_GATE) + if (!m_IsEnabled && go->GetGOInfo()->entry == GO_WINTERGRASP_VAULT_GATE) go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); BuildingsInZone.insert(b); } -- cgit v1.2.3 From b8decc89896ad71b0f808eaeb9c7fd45fffad06a Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 27 Aug 2012 13:01:54 -0400 Subject: Core/Wintergrasp: fix handling for invisible wall in wintergrasp. will now be destroyed and rebuilt with the vault gate --- src/server/game/Battlefield/Zones/BattlefieldWG.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/server') diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 462ad87fbc8..9f024bb0ba6 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -1200,6 +1200,9 @@ struct BfWGGameObjectBuilding if (m_Build->IsDestructibleBuilding()) { m_Build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true); + if (m_Build->GetEntry() == GO_WINTERGRASP_VAULT_GATE) + if (GameObject * go = m_Build->FindNearestGameObject(194323, 10.0f)) + go->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true); // Update worldstate m_State = BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT - (m_Team * 3); @@ -1255,6 +1258,8 @@ struct BfWGGameObjectBuilding m_WG->UpdatedDestroyedTowerCount(TeamId(m_Team)); break; case BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST: + if (GameObject* go = m_Build->FindNearestGameObject(194323, 10.0f)) + go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); m_WG->SetRelicInteractible(true); if (m_WG->GetRelic()) m_WG->GetRelic()->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); -- cgit v1.2.3 From 1d05d2d4fad8b2d204d42a4e446e08b20d17b9c4 Mon Sep 17 00:00:00 2001 From: CDawg Date: Mon, 27 Aug 2012 18:14:47 +0100 Subject: Core/Misc: Fix resting zone in inn or tavern, reduce the area resting is active Closes #7516 --- src/server/game/Entities/Player/Player.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f463a62e9fa..f97582a0198 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7507,8 +7507,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) if (GetRestType() == REST_TYPE_IN_TAVERN) // Still inside a tavern or has recently left { // Remove rest state if we have recently left a tavern. - // Why is 40 yd hardcoded? - if (GetMapId() != GetInnPosMapId() || GetExactDist(GetInnPosX(), GetInnPosY(), GetInnPosZ()) > 40.0f) + if (GetMapId() != GetInnPosMapId() || GetExactDist(GetInnPosX(), GetInnPosY(), GetInnPosZ()) > 1.0f) { RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); SetRestType(REST_TYPE_NO); -- cgit v1.2.3 From 7e2d007e0d842326b139fb7ef345d0036d244978 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Mon, 27 Aug 2012 19:57:26 +0200 Subject: Core/Spells: Fix 'Foam Sword Rack' mechanic --- .../2012_08_27_10_world_spell_script_names.sql | 4 + src/server/game/Spells/SpellEffects.cpp | 11 --- src/server/scripts/Spells/spell_generic.cpp | 92 ++++++++++++++++++++++ 3 files changed, 96 insertions(+), 11 deletions(-) create mode 100644 sql/updates/world/2012_08_27_10_world_spell_script_names.sql (limited to 'src/server') diff --git a/sql/updates/world/2012_08_27_10_world_spell_script_names.sql b/sql/updates/world/2012_08_27_10_world_spell_script_names.sql new file mode 100644 index 00000000000..9ffb153f498 --- /dev/null +++ b/sql/updates/world/2012_08_27_10_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`IN (64142,62991); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(64142,'spell_gen_upper_deck_create_foam_sword'), +(62991,'spell_gen_bonked'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 11356e8b155..a5e24ff1cec 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -4281,17 +4281,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) unitTarget->CastSpell(unitTarget, spellTarget[urand(0, 4)], true); break; } - case 64142: // Upper Deck - Create Foam Sword - if (unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - Player* player = unitTarget->ToPlayer(); - static uint32 const itemId[] = {45061, 45176, 45177, 45178, 45179, 0}; - // player can only have one of these items - for (uint32 const* itr = &itemId[0]; *itr; ++itr) - if (player->HasItemCount(*itr, 1, true)) - return; - DoCreateItem(effIndex, itemId[urand(0, 4)]); - return; } break; } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 9cbf81b39af..5eebb69d7a5 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3076,6 +3076,96 @@ class spell_gen_mount : public SpellScriptLoader uint32 _mount310; }; +enum FoamSword +{ + ITEM_FOAM_SWORD_GREEN = 45061, + ITEM_FOAM_SWORD_PINK = 45176, + ITEM_FOAM_SWORD_BLUE = 45177, + ITEM_FOAM_SWORD_RED = 45178, + ITEM_FOAM_SWORD_YELLOW = 45179, + + SPELL_BONKED = 62991, + SPELL_FOAM_SWORD_DEFEAT = 62994, + SPELL_ON_GUARD = 62972, +}; + +class spell_gen_upper_deck_create_foam_sword : public SpellScriptLoader +{ + public: + spell_gen_upper_deck_create_foam_sword() : SpellScriptLoader("spell_gen_upper_deck_create_foam_sword") { } + + class spell_gen_upper_deck_create_foam_sword_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_upper_deck_create_foam_sword_SpellScript); + + void HandleScript(SpellEffIndex effIndex) + { + if (Player* player = GetHitPlayer()) + { + static uint32 const itemId[5] = { ITEM_FOAM_SWORD_GREEN, ITEM_FOAM_SWORD_PINK, ITEM_FOAM_SWORD_BLUE, ITEM_FOAM_SWORD_RED, ITEM_FOAM_SWORD_YELLOW }; + // player can only have one of these items + for (uint8 i = 0; i < 5; ++i) + { + if (player->HasItemCount(itemId[i], 1, true)) + return; + } + + CreateItem(effIndex, itemId[urand(0, 4)]); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_upper_deck_create_foam_sword_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_upper_deck_create_foam_sword_SpellScript(); + } +}; + +class spell_gen_bonked : public SpellScriptLoader +{ + public: + spell_gen_bonked() : SpellScriptLoader("spell_gen_bonked") { } + + class spell_gen_bonked_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_bonked_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Player* target = GetHitPlayer()) + { + Aura const* aura = GetHitAura(); + if (!(aura && aura->GetStackAmount() == 3)) + return; + + target->CastSpell(target, SPELL_FOAM_SWORD_DEFEAT, true); + target->RemoveAurasDueToSpell(SPELL_BONKED); + + if (Aura const* aura = target->GetAura(SPELL_ON_GUARD)) + { + if (Item* item = target->GetItemByGuid(aura->GetCastItemGUID())) + target->DestroyItemCount(item->GetEntry(), 1, true); + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_bonked_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_bonked_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -3148,4 +3238,6 @@ void AddSC_generic_spell_scripts() new spell_gen_mount("spell_blazing_hippogryph", 0, 0, 0, SPELL_BLAZING_HIPPOGRYPH_150, SPELL_BLAZING_HIPPOGRYPH_280); new spell_gen_mount("spell_celestial_steed", 0, SPELL_CELESTIAL_STEED_60, SPELL_CELESTIAL_STEED_100, SPELL_CELESTIAL_STEED_150, SPELL_CELESTIAL_STEED_280, SPELL_CELESTIAL_STEED_310); new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310); + new spell_gen_upper_deck_create_foam_sword(); + new spell_gen_bonked(); } -- cgit v1.2.3 From 9a11dc5ea6a56c41c044d5b28323d2fb420e3201 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 27 Aug 2012 20:42:56 +0100 Subject: Config/worldserver: Rename references to the old realmd database to auth --- src/server/worldserver/worldserver.conf.dist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index a3ba270b4bd..9eab3c40a2d 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -49,7 +49,7 @@ # # RealmID # Description: ID of the Realm using this config. -# Important: RealmID must match the realmlist inside the realmd database. +# Important: RealmID must match the realmlist inside the auth database. # Default: 1 RealmID = 1 @@ -174,7 +174,7 @@ Compression = 1 # PlayerLimit # Description: Maximum number of players in the world. Excluding Mods, GMs and Admins. # Important: If you want to block players and only allow Mods, GMs or Admins to join the -# server, use the DB field "realmd.realmlist.allowedSecurityLevel". +# server, use the DB field "auth.realmlist.allowedSecurityLevel". # Default: 100 - (Enabled) # 1+ - (Enabled) # 0 - (Disabled, No limit) -- cgit v1.2.3 From c4f011f3324bc90631472bf2aa1b89590742909a Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Mon, 27 Aug 2012 22:58:45 +0200 Subject: Core/Battlefield: Small cleanup --- src/server/game/Battlefield/Zones/BattlefieldWG.cpp | 8 +------- src/server/game/Battlefield/Zones/BattlefieldWG.h | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 6d2d823e341..97e7bb5bef2 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -25,12 +25,6 @@ #include "SpellAuras.h" #include "Vehicle.h" -enum WintergrastData -{ - BATTLEFIELD_WG_ZONEID = 4197, // Wintergrasp - BATTLEFIELD_WG_MAPID = 571, // Northrend -}; - enum WGVehicles { NPC_WG_SEIGE_ENGINE_ALLIANCE = 28312, @@ -178,7 +172,7 @@ bool BattlefieldWG::SetupBattlefield() GameObject* go = SpawnGameObject(WGGameObjectBuilding[i].entry, WGGameObjectBuilding[i].x, WGGameObjectBuilding[i].y, WGGameObjectBuilding[i].z, WGGameObjectBuilding[i].o); BfWGGameObjectBuilding* b = new BfWGGameObjectBuilding(this); b->Init(go, WGGameObjectBuilding[i].type, WGGameObjectBuilding[i].WorldState, WGGameObjectBuilding[i].nameId); - if (!m_IsEnabled && go->GetGOInfo()->entry == GO_WINTERGRASP_VAULT_GATE) + if (!IsEnabled() && go->GetEntry() == GO_WINTERGRASP_VAULT_GATE) go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); BuildingsInZone.insert(b); } diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 9f024bb0ba6..4b06ac8237b 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -44,6 +44,12 @@ typedef std::set Workshop; typedef std::set GroupSet; //typedef std::set CapturePointSet; unused ? +enum WintergrastData +{ + BATTLEFIELD_WG_ZONEID = 4197, // Wintergrasp + BATTLEFIELD_WG_MAPID = 571, // Northrend +}; + enum WintergraspSpells { // Wartime auras @@ -435,7 +441,6 @@ class BattlefieldWG : public Battlefield GameObject* m_titansRelic; }; -uint32 const NORTHREND_WINTERGRASP = 4197; uint8 const WG_MAX_OBJ = 32; uint8 const WG_KEEPGAMEOBJECT_MAX = 44; uint8 const WG_MAX_TURRET = 15; @@ -544,6 +549,8 @@ enum WintergraspGameObject GO_WINTERGRASP_FORTRESS_GATE = 190375, GO_WINTERGRASP_VAULT_GATE = 191810, + GO_WINTERGRASP_KEEP_COLLISION_WALL = 194323, + }; struct WintergraspObjectPositionData @@ -1201,7 +1208,7 @@ struct BfWGGameObjectBuilding { m_Build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true); if (m_Build->GetEntry() == GO_WINTERGRASP_VAULT_GATE) - if (GameObject * go = m_Build->FindNearestGameObject(194323, 10.0f)) + if (GameObject* go = m_Build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 10.0f)) go->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true); // Update worldstate @@ -1258,7 +1265,7 @@ struct BfWGGameObjectBuilding m_WG->UpdatedDestroyedTowerCount(TeamId(m_Team)); break; case BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST: - if (GameObject* go = m_Build->FindNearestGameObject(194323, 10.0f)) + if (GameObject* go = m_Build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 10.0f)) go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); m_WG->SetRelicInteractible(true); if (m_WG->GetRelic()) @@ -1413,7 +1420,7 @@ struct BfWGGameObjectBuilding { Position towerCannonPos; TowerCannon[towerid].TurretTop[i].GetPosition(&towerCannonPos); - if (Creature *turret = m_WG->SpawnCreature(28366, towerCannonPos, TeamId(0))) + if (Creature* turret = m_WG->SpawnCreature(28366, towerCannonPos, TeamId(0))) { m_TurretTopList.insert(turret->GetGUID()); switch (go->GetEntry()) @@ -1653,9 +1660,9 @@ struct WintergraspWorkshopData // Spawning Associate gameobject and store them void AddGameObject(WintergraspObjectPositionData obj) { - if (GameObject *gameobject = m_WG->SpawnGameObject(obj.entryHorde, obj.x, obj.y, obj.z, obj.o)) + if (GameObject* gameobject = m_WG->SpawnGameObject(obj.entryHorde, obj.x, obj.y, obj.z, obj.o)) m_GameObjectOnPoint[TEAM_HORDE].insert(gameobject); - if (GameObject *gameobject = m_WG->SpawnGameObject(obj.entryAlliance, obj.x, obj.y, obj.z, obj.o)) + if (GameObject* gameobject = m_WG->SpawnGameObject(obj.entryAlliance, obj.x, obj.y, obj.z, obj.o)) m_GameObjectOnPoint[TEAM_ALLIANCE].insert(gameobject); } -- cgit v1.2.3