Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
480 changes: 242 additions & 238 deletions src/server/game/Entities/Object/Object.cpp

Large diffs are not rendered by default.

5,879 changes: 2,967 additions & 2,912 deletions src/server/game/Entities/Player/Player.cpp

Large diffs are not rendered by default.

3,142 changes: 1,572 additions & 1,570 deletions src/server/game/Entities/Player/Player.h

Large diffs are not rendered by default.

2,054 changes: 1,048 additions & 1,006 deletions src/server/game/Spells/SpellEffects.cpp

Large diffs are not rendered by default.

130 changes: 67 additions & 63 deletions src/server/scripts/Northrend/zone_wintergrasp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,19 @@ struct npc_wg_demolisher_engineer : public ScriptedAI
{
if (player->HasAura(SPELL_WINTERGRASP_CORPORAL))
{
AddGossipItemFor(player, me->GetEntry() == NPC_WINTERGRASP_GOBLIN_MECHANIC ? GOSSIP_MENU_ENGINEER_HORDE : GOSSIP_MENU_ENGINEER_ALLIANCE, GOSSIP_MENU_OPTION_ENGINEER_CATAPULT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
AddGossipItemFor(player, me->GetEntry() == NPC_WINTERGRASP_GOBLIN_MECHANIC ? GOSSIP_MENU_ENGINEER_HORDE : GOSSIP_MENU_ENGINEER_ALLIANCE, GOSSIP_MENU_OPTION_ENGINEER_CATAPULT, GOSSIP_SENDER_MAIN,
GOSSIP_ACTION_INFO_DEF);
SendGossipMenuFor(player, me->GetEntry() == NPC_WINTERGRASP_GOBLIN_MECHANIC ? NPC_TEXT_HORDE_HOW_CAN_I_HELP : NPC_TEXT_ALLIANCE_HOW_CAN_I_HELP, me);
return true;
}
else if (player->HasAura(SPELL_WINTERGRASP_LIEUTENANT))
{
AddGossipItemFor(player, me->GetEntry() == NPC_WINTERGRASP_GOBLIN_MECHANIC ? GOSSIP_MENU_ENGINEER_HORDE : GOSSIP_MENU_ENGINEER_ALLIANCE, GOSSIP_MENU_OPTION_ENGINEER_CATAPULT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
AddGossipItemFor(player, me->GetEntry() == NPC_WINTERGRASP_GOBLIN_MECHANIC ? GOSSIP_MENU_ENGINEER_HORDE : GOSSIP_MENU_ENGINEER_ALLIANCE, GOSSIP_MENU_OPTION_ENGINEER_DEMOLISHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
AddGossipItemFor(player, me->GetEntry() == NPC_WINTERGRASP_GOBLIN_MECHANIC ? GOSSIP_MENU_ENGINEER_HORDE : GOSSIP_MENU_ENGINEER_ALLIANCE, GOSSIP_MENU_OPTION_ENGINEER_SIEGE_ENGINE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
AddGossipItemFor(player, me->GetEntry() == NPC_WINTERGRASP_GOBLIN_MECHANIC ? GOSSIP_MENU_ENGINEER_HORDE : GOSSIP_MENU_ENGINEER_ALLIANCE, GOSSIP_MENU_OPTION_ENGINEER_CATAPULT, GOSSIP_SENDER_MAIN,
GOSSIP_ACTION_INFO_DEF);
AddGossipItemFor(player, me->GetEntry() == NPC_WINTERGRASP_GOBLIN_MECHANIC ? GOSSIP_MENU_ENGINEER_HORDE : GOSSIP_MENU_ENGINEER_ALLIANCE, GOSSIP_MENU_OPTION_ENGINEER_DEMOLISHER, GOSSIP_SENDER_MAIN,
GOSSIP_ACTION_INFO_DEF + 1);
AddGossipItemFor(player, me->GetEntry() == NPC_WINTERGRASP_GOBLIN_MECHANIC ? GOSSIP_MENU_ENGINEER_HORDE : GOSSIP_MENU_ENGINEER_ALLIANCE, GOSSIP_MENU_OPTION_ENGINEER_SIEGE_ENGINE, GOSSIP_SENDER_MAIN,
GOSSIP_ACTION_INFO_DEF + 2);
SendGossipMenuFor(player, me->GetEntry() == NPC_WINTERGRASP_GOBLIN_MECHANIC ? NPC_TEXT_HORDE_HOW_CAN_I_HELP : NPC_TEXT_ALLIANCE_HOW_CAN_I_HELP, me);
return true;
}
Expand Down Expand Up @@ -175,17 +179,17 @@ struct npc_wg_demolisher_engineer : public ScriptedAI

switch (selection)
{
case 0:
DoCast(player, SPELL_BUILD_CATAPULT_FORCE, true);
break;
case 1:
DoCast(player, SPELL_BUILD_DEMOLISHER_FORCE, true);
break;
case 2:
DoCast(player, player->GetTeamId() == TEAM_ALLIANCE ? SPELL_BUILD_SIEGE_VEHICLE_FORCE_ALLIANCE : SPELL_BUILD_SIEGE_VEHICLE_FORCE_HORDE, true);
break;
default:
break;
case 0:
DoCast(player, SPELL_BUILD_CATAPULT_FORCE, true);
break;
case 1:
DoCast(player, SPELL_BUILD_DEMOLISHER_FORCE, true);
break;
case 2:
DoCast(player, player->GetTeamId() == TEAM_ALLIANCE ? SPELL_BUILD_SIEGE_VEHICLE_FORCE_ALLIANCE : SPELL_BUILD_SIEGE_VEHICLE_FORCE_HORDE, true);
break;
default:
break;
}
}
return true;
Expand All @@ -200,12 +204,12 @@ struct npc_wg_demolisher_engineer : public ScriptedAI

switch (me->GetEntry())
{
case NPC_WINTERGRASP_GOBLIN_MECHANIC:
//return (wintergrasp->GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H) > wintergrasp->GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
case NPC_WINTERGRASP_GNOMISH_ENGINEER:
//return (wintergrasp->GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A) > wintergrasp->GetData(BATTLEFIELD_WG_DATA_VEHICLE_A));
default:
return false;
case NPC_WINTERGRASP_GOBLIN_MECHANIC:
//return (wintergrasp->GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H) > wintergrasp->GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
case NPC_WINTERGRASP_GNOMISH_ENGINEER:
//return (wintergrasp->GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A) > wintergrasp->GetData(BATTLEFIELD_WG_DATA_VEHICLE_A));
default:
return false;
}
}
};
Expand Down Expand Up @@ -273,12 +277,12 @@ class spell_wintergrasp_force_building : public SpellScript
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo(
{
SPELL_BUILD_CATAPULT_FORCE,
SPELL_BUILD_DEMOLISHER_FORCE,
SPELL_BUILD_SIEGE_VEHICLE_FORCE_HORDE,
SPELL_BUILD_SIEGE_VEHICLE_FORCE_ALLIANCE
});
{
SPELL_BUILD_CATAPULT_FORCE,
SPELL_BUILD_DEMOLISHER_FORCE,
SPELL_BUILD_SIEGE_VEHICLE_FORCE_HORDE,
SPELL_BUILD_SIEGE_VEHICLE_FORCE_ALLIANCE
});
}

void HandleScript(SpellEffIndex effIndex)
Expand Down Expand Up @@ -389,8 +393,8 @@ class spell_wintergrasp_tenacity_refresh : public AuraScript

CastSpellExtraArgs args(aurEff);
args
.AddSpellMod(SPELLVALUE_BASE_POINT0, bp)
.AddSpellMod(SPELLVALUE_BASE_POINT1, bp);
.AddSpellMod(SPELLVALUE_BASE_POINT0, bp)
.AddSpellMod(SPELLVALUE_BASE_POINT1, bp);
GetTarget()->CastSpell(nullptr, triggeredSpellId, args);
}

Expand Down Expand Up @@ -439,54 +443,54 @@ class spell_wintergrasp_waiting_to_resurrect : public AuraScript

class achievement_wg_didnt_stand_a_chance : public AchievementCriteriaScript
{
public:
achievement_wg_didnt_stand_a_chance() : AchievementCriteriaScript("achievement_wg_didnt_stand_a_chance") { }
public:
achievement_wg_didnt_stand_a_chance() : AchievementCriteriaScript("achievement_wg_didnt_stand_a_chance") { }

bool OnCheck(Player* source, Unit* target) override
{
if (!target)
return false;

bool OnCheck(Player* source, Unit* target) override
if (Player* victim = target->ToPlayer())
{
if (!target)
if (!victim->IsMounted())
return false;

if (Player* victim = target->ToPlayer())
{
if (!victim->IsMounted())
return false;

if (Vehicle* vehicle = source->GetVehicle())
if (vehicle->GetVehicleInfo()->m_ID == 244) // Wintergrasp Tower Cannon
return true;
}

return false;
if (Vehicle* vehicle = source->GetVehicle())
if (vehicle->GetVehicleInfo()->m_ID == 244) // Wintergrasp Tower Cannon
return true;
}

return false;
}
};

class condition_is_wintergrasp_horde : public ConditionScript
{
public:
condition_is_wintergrasp_horde() : ConditionScript("condition_is_wintergrasp_horde") { }
public:
condition_is_wintergrasp_horde() : ConditionScript("condition_is_wintergrasp_horde") { }

bool OnConditionCheck(Condition const* /*condition*/, ConditionSourceInfo& /*sourceInfo*/)
{
Battlefield* wintergrasp = sBattlefieldMgr->GetEnabledBattlefield(BATTLEFIELD_BATTLEID_WINTERGRASP);
if (wintergrasp && wintergrasp->GetControllingTeam() == PVP_TEAM_HORDE)
return true;
return false;
}
bool OnConditionCheck(Condition const* /*condition*/, ConditionSourceInfo& /*sourceInfo*/)
{
Battlefield* wintergrasp = sBattlefieldMgr->GetEnabledBattlefield(BATTLEFIELD_BATTLEID_WINTERGRASP);
if (wintergrasp && wintergrasp->GetControllingTeam() == PVP_TEAM_HORDE)
return true;
return false;
}
};

class condition_is_wintergrasp_alliance : public ConditionScript
{
public:
condition_is_wintergrasp_alliance() : ConditionScript("condition_is_wintergrasp_alliance") { }
public:
condition_is_wintergrasp_alliance() : ConditionScript("condition_is_wintergrasp_alliance") { }

bool OnConditionCheck(Condition const* /*condition*/, ConditionSourceInfo& /*sourceInfo*/)
{
Battlefield* wintergrasp = sBattlefieldMgr->GetEnabledBattlefield(BATTLEFIELD_BATTLEID_WINTERGRASP);
if (wintergrasp && wintergrasp->GetControllingTeam() == PVP_TEAM_ALLIANCE)
return true;
return false;
}
bool OnConditionCheck(Condition const* /*condition*/, ConditionSourceInfo& /*sourceInfo*/)
{
Battlefield* wintergrasp = sBattlefieldMgr->GetEnabledBattlefield(BATTLEFIELD_BATTLEID_WINTERGRASP);
if (wintergrasp && wintergrasp->GetControllingTeam() == PVP_TEAM_ALLIANCE)
return true;
return false;
}
};

void AddSC_wintergrasp()
Expand All @@ -502,4 +506,4 @@ void AddSC_wintergrasp()
new achievement_wg_didnt_stand_a_chance();
new condition_is_wintergrasp_horde();
new condition_is_wintergrasp_alliance();
}
}
4 changes: 2 additions & 2 deletions src/server/shared/DataStores/DBCEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ enum FactionTemplateFlags
{
FACTION_TEMPLATE_FLAG_PVP = 0x00000800, // flagged for PvP
FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats
FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT= 0x00002000
FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT = 0x00002000
};

enum FactionMasks
Expand All @@ -328,7 +328,7 @@ enum FactionMasks
FACTION_MASK_ALLIANCE = 2, // player or creature from alliance team
FACTION_MASK_HORDE = 4, // player or creature from horde team
FACTION_MASK_MONSTER = 8 // aggressive creature from monster team
// if none flags set then non-aggressive creature
// if none flags set then non-aggressive creature
};

enum MapTypes // Lua_IsInInstance
Expand Down
Loading