mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
converted all tabs to 4 spaces
This commit is contained in:
@@ -240,12 +240,12 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_GIFT_BY_ITEM);
|
||||
|
||||
stmt->setUInt32(0, item->GetGUIDLow());
|
||||
stmt->setUInt32(0, item->GetGUIDLow());
|
||||
|
||||
_openWrappedItemCallback.SetFirstParam(bagIndex);
|
||||
_openWrappedItemCallback.SetSecondParam(slot);
|
||||
_openWrappedItemCallback.SetThirdParam(item->GetGUIDLow());
|
||||
_openWrappedItemCallback.SetFutureResult(CharacterDatabase.AsyncQuery(stmt));
|
||||
_openWrappedItemCallback.SetFirstParam(bagIndex);
|
||||
_openWrappedItemCallback.SetSecondParam(slot);
|
||||
_openWrappedItemCallback.SetThirdParam(item->GetGUIDLow());
|
||||
_openWrappedItemCallback.SetFutureResult(CharacterDatabase.AsyncQuery(stmt));
|
||||
}
|
||||
else
|
||||
pUser->SendLoot(item->GetGUID(), LOOT_CORPSE);
|
||||
@@ -256,14 +256,14 @@ void WorldSession::HandleOpenWrappedItemCallback(PreparedQueryResult result, uin
|
||||
if (!GetPlayer())
|
||||
return;
|
||||
|
||||
Item* item = GetPlayer()->GetItemByPos(bagIndex, slot);
|
||||
if (!item)
|
||||
return;
|
||||
Item* item = GetPlayer()->GetItemByPos(bagIndex, slot);
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
if (item->GetGUIDLow() != itemLowGUID || !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) // during getting result, gift was swapped with another item
|
||||
return;
|
||||
if (item->GetGUIDLow() != itemLowGUID || !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) // during getting result, gift was swapped with another item
|
||||
return;
|
||||
|
||||
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog->outError("Wrapped item %u don't have record in character_gifts table and will deleted", item->GetGUIDLow());
|
||||
@@ -280,16 +280,16 @@ void WorldSession::HandleOpenWrappedItemCallback(PreparedQueryResult result, uin
|
||||
item->SetUInt64Value(ITEM_FIELD_GIFTCREATOR, 0);
|
||||
item->SetEntry(entry);
|
||||
item->SetUInt32Value(ITEM_FIELD_FLAGS, flags);
|
||||
item->SetUInt32Value(ITEM_FIELD_MAXDURABILITY, item->GetTemplate()->MaxDurability);
|
||||
item->SetUInt32Value(ITEM_FIELD_MAXDURABILITY, item->GetTemplate()->MaxDurability);
|
||||
|
||||
item->SetState(ITEM_CHANGED, GetPlayer());
|
||||
GetPlayer()->SaveInventoryAndGoldToDB(trans);
|
||||
GetPlayer()->SaveInventoryAndGoldToDB(trans);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT);
|
||||
stmt->setUInt32(0, item->GetGUIDLow());
|
||||
trans->Append(stmt);
|
||||
trans->Append(stmt);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recvData)
|
||||
@@ -374,24 +374,24 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
}
|
||||
else
|
||||
{
|
||||
// pussywizard: casting player's spells from vehicle when seat allows it
|
||||
// if ANYTHING CHANGES in this function, INFORM ME BEFORE applying!!!
|
||||
if (Vehicle* veh = mover->GetVehicleKit())
|
||||
if (const VehicleSeatEntry* seat = veh->GetSeatForPassenger(_player))
|
||||
if (seat->m_flags & VEHICLE_SEAT_FLAG_CAN_ATTACK || spellInfo->Effects[EFFECT_0].Effect == SPELL_EFFECT_OPEN_LOCK /*allow looting from vehicle, but only if player has required spell (all necessary opening spells are in playercreateinfo_spell)*/)
|
||||
if ((mover->GetTypeId() == TYPEID_UNIT && !mover->ToCreature()->HasSpell(spellId)) || spellInfo->IsPassive()) // the creature can't cast that spell, check player instead
|
||||
{
|
||||
if( !(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!_player->HasActiveSpell (spellId) || spellInfo->IsPassive()) )
|
||||
{
|
||||
//cheater? kick? ban?
|
||||
recvPacket.rfinish(); // prevent spam at ignore packet
|
||||
return;
|
||||
}
|
||||
// pussywizard: casting player's spells from vehicle when seat allows it
|
||||
// if ANYTHING CHANGES in this function, INFORM ME BEFORE applying!!!
|
||||
if (Vehicle* veh = mover->GetVehicleKit())
|
||||
if (const VehicleSeatEntry* seat = veh->GetSeatForPassenger(_player))
|
||||
if (seat->m_flags & VEHICLE_SEAT_FLAG_CAN_ATTACK || spellInfo->Effects[EFFECT_0].Effect == SPELL_EFFECT_OPEN_LOCK /*allow looting from vehicle, but only if player has required spell (all necessary opening spells are in playercreateinfo_spell)*/)
|
||||
if ((mover->GetTypeId() == TYPEID_UNIT && !mover->ToCreature()->HasSpell(spellId)) || spellInfo->IsPassive()) // the creature can't cast that spell, check player instead
|
||||
{
|
||||
if( !(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!_player->HasActiveSpell (spellId) || spellInfo->IsPassive()) )
|
||||
{
|
||||
//cheater? kick? ban?
|
||||
recvPacket.rfinish(); // prevent spam at ignore packet
|
||||
return;
|
||||
}
|
||||
|
||||
// at this point, player is a valid caster
|
||||
// swapping the mover will stop the check below at == TYPEID_UNIT, so everything works fine
|
||||
mover = _player;
|
||||
}
|
||||
// at this point, player is a valid caster
|
||||
// swapping the mover will stop the check below at == TYPEID_UNIT, so everything works fine
|
||||
mover = _player;
|
||||
}
|
||||
|
||||
// not have spell in spellbook or spell passive and not casted by client
|
||||
if ((mover->GetTypeId() == TYPEID_UNIT && !mover->ToCreature()->HasSpell(spellId)) || spellInfo->IsPassive())
|
||||
@@ -452,7 +452,7 @@ void WorldSession::HandleCancelCastOpcode(WorldPacket& recvPacket)
|
||||
recvPacket.read_skip<uint8>(); // counter, increments with every CANCEL packet, don't use for now
|
||||
recvPacket >> spellId;
|
||||
|
||||
_player->InterruptSpell(CURRENT_MELEE_SPELL);
|
||||
_player->InterruptSpell(CURRENT_MELEE_SPELL);
|
||||
if (_player->IsNonMeleeSpellCast(false))
|
||||
_player->InterruptNonMeleeSpells(false, spellId, false, true);
|
||||
}
|
||||
@@ -467,7 +467,7 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
|
||||
// not allow remove non positive spells and spells with attr SPELL_ATTR0_CANT_CANCEL
|
||||
if ((!spellInfo->IsPositive() || spellInfo->HasAttribute(SPELL_ATTR0_CANT_CANCEL) || spellInfo->IsPassive()) && spellId != 605)
|
||||
if ((!spellInfo->IsPositive() || spellInfo->HasAttribute(SPELL_ATTR0_CANT_CANCEL) || spellInfo->IsPassive()) && spellId != 605)
|
||||
return;
|
||||
|
||||
// channeled spell case (it currently casted then)
|
||||
@@ -580,10 +580,10 @@ void WorldSession::HandleSelfResOpcode(WorldPacket & /*recvData*/)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(_player->GetUInt32Value(PLAYER_SELF_RES_SPELL));
|
||||
if (spellInfo)
|
||||
{
|
||||
{
|
||||
_player->CastSpell(_player, spellInfo, true, 0);
|
||||
_player->AddSpellAndCategoryCooldowns(spellInfo, 0);
|
||||
}
|
||||
_player->AddSpellAndCategoryCooldowns(spellInfo, 0);
|
||||
}
|
||||
|
||||
_player->SetUInt32Value(PLAYER_SELF_RES_SPELL, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user