mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
Revert "Core: more more cleanup" - Build test anyone?
This reverts commit 20cd4c71ee.
This commit is contained in:
@@ -163,15 +163,15 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
char* item = handler->extractKeyFromLink((char*)args, "Hitem");
|
||||
if (!item)
|
||||
char* pitem = handler->extractKeyFromLink((char*)args, "Hitem");
|
||||
if (!pitem)
|
||||
{
|
||||
handler->SendSysMessage(LANG_COMMAND_NEEDITEMSEND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
int32 item_int = atol(item);
|
||||
int32 item_int = atol(pitem);
|
||||
if (item_int <= 0)
|
||||
return false;
|
||||
|
||||
@@ -411,14 +411,14 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
char* item = handler->extractKeyFromLink((char*)args, "Hitem");
|
||||
if (!item)
|
||||
char* pitem = handler->extractKeyFromLink((char*)args, "Hitem");
|
||||
if (!pitem)
|
||||
{
|
||||
handler->SendSysMessage(LANG_COMMAND_NEEDITEMSEND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
uint32 itemId = atol(item);
|
||||
uint32 itemId = atol(pitem);
|
||||
|
||||
if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId))
|
||||
{
|
||||
|
||||
@@ -267,11 +267,11 @@ public:
|
||||
//dosen't work at all
|
||||
if (uiShieldBreakerTimer <= uiDiff)
|
||||
{
|
||||
Vehicle* vehicle = me->GetVehicleKit();
|
||||
if (!vehicle)
|
||||
Vehicle* pVehicle = me->GetVehicleKit();
|
||||
if (!pVehicle)
|
||||
return;
|
||||
|
||||
if (Unit* pPassenger = vehicle->GetPassenger(SEAT_ID_0))
|
||||
if (Unit* pPassenger = pVehicle->GetPassenger(SEAT_ID_0))
|
||||
{
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
if (me->GetMap()->IsDungeon() && !players.isEmpty())
|
||||
|
||||
@@ -221,8 +221,8 @@ public:
|
||||
{
|
||||
uiVehicle1GUID = pBoss->GetGUID();
|
||||
uint64 uiGrandChampionBoss1 = 0;
|
||||
if (Vehicle* vehicle = pBoss->GetVehicleKit())
|
||||
if (Unit* unit = vehicle->GetPassenger(0))
|
||||
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
|
||||
if (Unit* unit = pVehicle->GetPassenger(0))
|
||||
uiGrandChampionBoss1 = unit->GetGUID();
|
||||
if (instance)
|
||||
{
|
||||
@@ -236,8 +236,8 @@ public:
|
||||
{
|
||||
uiVehicle2GUID = pBoss->GetGUID();
|
||||
uint64 uiGrandChampionBoss2 = 0;
|
||||
if (Vehicle* vehicle = pBoss->GetVehicleKit())
|
||||
if (Unit* unit = vehicle->GetPassenger(0))
|
||||
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
|
||||
if (Unit* unit = pVehicle->GetPassenger(0))
|
||||
uiGrandChampionBoss2 = unit->GetGUID();
|
||||
if (instance)
|
||||
{
|
||||
@@ -251,8 +251,8 @@ public:
|
||||
{
|
||||
uiVehicle3GUID = pBoss->GetGUID();
|
||||
uint64 uiGrandChampionBoss3 = 0;
|
||||
if (Vehicle* vehicle = pBoss->GetVehicleKit())
|
||||
if (Unit* unit = vehicle->GetPassenger(0))
|
||||
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
|
||||
if (Unit* unit = pVehicle->GetPassenger(0))
|
||||
uiGrandChampionBoss3 = unit->GetGUID();
|
||||
if (instance)
|
||||
{
|
||||
|
||||
@@ -176,9 +176,9 @@ public:
|
||||
{
|
||||
if (AggroYellTimer <= diff)
|
||||
{
|
||||
if (Unit* member = Unit::GetUnit(*me, Council[YellCounter]))
|
||||
if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter]))
|
||||
{
|
||||
DoScriptText(CouncilAggro[YellCounter].entry, member);
|
||||
DoScriptText(CouncilAggro[YellCounter].entry, pMember);
|
||||
AggroYellTimer = CouncilAggro[YellCounter].timer;
|
||||
}
|
||||
++YellCounter;
|
||||
@@ -191,10 +191,10 @@ public:
|
||||
{
|
||||
if (EnrageTimer <= diff)
|
||||
{
|
||||
if (Unit* member = Unit::GetUnit(*me, Council[YellCounter]))
|
||||
if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter]))
|
||||
{
|
||||
member->CastSpell(member, SPELL_BERSERK, true);
|
||||
DoScriptText(CouncilEnrage[YellCounter].entry, member);
|
||||
pMember->CastSpell(pMember, SPELL_BERSERK, true);
|
||||
DoScriptText(CouncilEnrage[YellCounter].entry, pMember);
|
||||
EnrageTimer = CouncilEnrage[YellCounter].timer;
|
||||
}
|
||||
++YellCounter;
|
||||
@@ -242,19 +242,19 @@ public:
|
||||
|
||||
DeathCount = 0;
|
||||
|
||||
Creature* member = NULL;
|
||||
Creature* pMember = NULL;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
member = Unit::GetCreature((*me), Council[i]);
|
||||
if (!member)
|
||||
pMember = Unit::GetCreature((*me), Council[i]);
|
||||
if (!pMember)
|
||||
continue;
|
||||
|
||||
if (!member->isAlive())
|
||||
if (!pMember->isAlive())
|
||||
{
|
||||
member->RemoveCorpse();
|
||||
member->Respawn();
|
||||
pMember->RemoveCorpse();
|
||||
pMember->Respawn();
|
||||
}
|
||||
member->AI()->EnterEvadeMode();
|
||||
pMember->AI()->EnterEvadeMode();
|
||||
}
|
||||
|
||||
if (instance)
|
||||
@@ -332,9 +332,9 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* member = (Unit::GetCreature(*me, Council[DeathCount]));
|
||||
if (member && member->isAlive())
|
||||
member->DealDamage(member, member->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
Creature* pMember = (Unit::GetCreature(*me, Council[DeathCount]));
|
||||
if (pMember && pMember->isAlive())
|
||||
pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
++DeathCount;
|
||||
EndEventTimer = 1500;
|
||||
} else EndEventTimer -= diff;
|
||||
|
||||
@@ -55,8 +55,8 @@ class spell_item_trigger_spell : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Item* item = GetCastItem())
|
||||
caster->CastSpell(caster, _triggeredSpellId, true, item);
|
||||
if (Item* pItem = GetCastItem())
|
||||
caster->CastSpell(caster, _triggeredSpellId, true, pItem);
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -47,9 +47,9 @@ class item_only_for_flight : public ItemScript
|
||||
public:
|
||||
item_only_for_flight() : ItemScript("item_only_for_flight") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/)
|
||||
bool OnUse(Player* player, Item* pItem, SpellCastTargets const& /*targets*/)
|
||||
{
|
||||
uint32 itemId = item->GetEntry();
|
||||
uint32 itemId = pItem->GetEntry();
|
||||
bool disabled = false;
|
||||
|
||||
//for special scripts
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
return false;
|
||||
|
||||
// error
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -110,13 +110,13 @@ class item_gor_dreks_ointment : public ItemScript
|
||||
public:
|
||||
item_gor_dreks_ointment() : ItemScript("item_gor_dreks_ointment") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& targets)
|
||||
bool OnUse(Player* player, Item* pItem, SpellCastTargets const& targets)
|
||||
{
|
||||
if (targets.GetUnitTarget() && targets.GetUnitTarget()->GetTypeId() == TYPEID_UNIT &&
|
||||
targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578))
|
||||
return false;
|
||||
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -130,13 +130,13 @@ class item_incendiary_explosives : public ItemScript
|
||||
public:
|
||||
item_incendiary_explosives() : ItemScript("item_incendiary_explosives") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const & /*targets*/)
|
||||
bool OnUse(Player* player, Item* pItem, SpellCastTargets const & /*targets*/)
|
||||
{
|
||||
if (player->FindNearestCreature(26248, 15) || player->FindNearestCreature(26249, 15))
|
||||
return false;
|
||||
else
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -219,7 +219,7 @@ class item_pile_fake_furs : public ItemScript
|
||||
public:
|
||||
item_pile_fake_furs() : ItemScript("item_pile_fake_furs") { }
|
||||
|
||||
bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const & /*targets*/)
|
||||
bool OnUse(Player* player, Item* /*pItem*/, SpellCastTargets const & /*targets*/)
|
||||
{
|
||||
GameObject* go = NULL;
|
||||
for (uint8 i = 0; i < CaribouTrapsNum; ++i)
|
||||
@@ -264,14 +264,14 @@ class item_petrov_cluster_bombs : public ItemScript
|
||||
public:
|
||||
item_petrov_cluster_bombs() : ItemScript("item_petrov_cluster_bombs") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/)
|
||||
bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*targets*/)
|
||||
{
|
||||
if (player->GetZoneId() != ZONE_ID_HOWLING)
|
||||
return false;
|
||||
|
||||
if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_NONE, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL);
|
||||
|
||||
if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB))
|
||||
Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE);
|
||||
@@ -330,7 +330,7 @@ class item_dehta_trap_smasher : public ItemScript
|
||||
public:
|
||||
item_dehta_trap_smasher() : ItemScript("item_dehta_trap_smasher") { }
|
||||
|
||||
bool OnUse(Player* player, Item* /*item*/, const SpellCastTargets & /*targets*/)
|
||||
bool OnUse(Player* player, Item* /*pItem*/, const SpellCastTargets & /*targets*/)
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE)
|
||||
return false;
|
||||
@@ -367,7 +367,7 @@ class item_trident_of_nazjan : public ItemScript
|
||||
public:
|
||||
item_trident_of_nazjan() : ItemScript("item_Trident_of_Nazjan") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/)
|
||||
bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*targets*/)
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
@@ -376,9 +376,9 @@ public:
|
||||
pLeviroth->AI()->AttackStart(player);
|
||||
return false;
|
||||
} else
|
||||
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL);
|
||||
} else
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -394,17 +394,17 @@ class item_captured_frog : public ItemScript
|
||||
public:
|
||||
item_captured_frog() : ItemScript("item_captured_frog") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/)
|
||||
bool OnUse(Player* player, Item* pItem, SpellCastTargets const& /*targets*/)
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_THE_PERFECT_SPIES) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (player->FindNearestCreature(NPC_VANIRAS_SENTRY_TOTEM, 10.0f))
|
||||
return false;
|
||||
else
|
||||
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL);
|
||||
}
|
||||
else
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -241,14 +241,14 @@ bool EquippedOk(Player* player, uint32 spellId)
|
||||
if (!reqSpell)
|
||||
continue;
|
||||
|
||||
Item* item;
|
||||
Item* pItem;
|
||||
for (uint8 j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; ++j)
|
||||
{
|
||||
item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j);
|
||||
if (item && item->GetTemplate()->RequiredSpell == reqSpell)
|
||||
pItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j);
|
||||
if (pItem && pItem->GetTemplate()->RequiredSpell == reqSpell)
|
||||
{
|
||||
//player has item equipped that require specialty. Not allow to unlearn, player has to unequip first
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry());
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, pItem->GetEntry());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user