More warning removal (Some code modifications and cleanup when needed)

--HG--
branch : trunk
This commit is contained in:
Spp
2010-04-19 17:03:10 +02:00
parent f74e969a06
commit be01821050
46 changed files with 420 additions and 353 deletions
+4 -1
View File
@@ -1099,7 +1099,9 @@ WorldSafeLocsEntry const* BattleGroundAV::GetClosestGraveYard(Player* player)
for (uint8 i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i)
if (m_Nodes[i].Owner == player->GetTeam() && m_Nodes[i].State == POINT_CONTROLED)
if (entry = sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[i]))
{
entry = sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[i]);
if (entry)
{
dist = (entry->x - x)*(entry->x - x)+(entry->y - y)*(entry->y - y);
if (dist < minDist)
@@ -1108,6 +1110,7 @@ WorldSafeLocsEntry const* BattleGroundAV::GetClosestGraveYard(Player* player)
pGraveyard = entry;
}
}
}
return pGraveyard;
}
+3 -1
View File
@@ -106,7 +106,9 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data)
if (instanceId)
bg = sBattleGroundMgr.GetBattleGroundThroughClientInstance(instanceId, bgTypeId);
if (!bg && !(bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId)))
if (!bg)
bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
if (!bg)
return;
// expected bracket entry
+1 -1
View File
@@ -488,7 +488,7 @@ void BattleGroundSA::DestroyGate(uint32 i, Player* pl)
if (g->GetGOValue()->building.health == 0)
{
GateStatus[i] = BG_SA_GATE_DESTROYED;
uint32 uws;
uint32 uws = 0;
switch(i)
{
case 0:
+3 -2
View File
@@ -374,9 +374,10 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
target = owner;
}
}
else if ((target = me->getVictim()))
else
{
if (target->GetTypeId() != TYPEID_PLAYER)
target = me->getVictim();
if (target && target->GetTypeId() != TYPEID_PLAYER)
if (Unit* owner = target->GetOwner())
if (owner->GetTypeId() == TYPEID_PLAYER)
target = owner;
+1 -1
View File
@@ -77,7 +77,7 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z)
y = owner.GetPositionY();
z = owner.GetPositionZ();
float temp_x, temp_y, angle;
float temp_x, temp_y, angle = 0;
const Map * _map = owner.GetBaseMap();
//primitive path-finding
for (uint8 i = 0; i < 18; ++i)
+1 -1
View File
@@ -913,7 +913,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
uint8 maxresul = 0;
uint64 maxguid = (*roll->playerVote.begin()).first;
Player *player;
RollVote rollvote;
RollVote rollvote = NOT_VALID;
Roll::PlayerVote::iterator itr;
for (itr = roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr)
+1 -1
View File
@@ -972,7 +972,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
uint8 BankTab, BankTabSlot, AutoStore;
uint8 PlayerSlot = NULL_SLOT;
uint8 PlayerBag = NULL_BAG;
uint8 BankTabDst, BankTabSlotDst, unk2;
uint8 BankTabDst = 0, BankTabSlotDst = 0, unk2;
uint8 ToChar = 1;
uint32 ItemEntry, unk1;
uint32 AutoStoreCount = 0;
+2 -2
View File
@@ -6902,13 +6902,13 @@ bool ChatHandler::HandleServerSetClosedCommand(const char *args)
{
std::string arg = args;
if (args == "on")
if (strncmp(args, "on", 3) == 0)
{
SendSysMessage(LANG_WORLD_CLOSED);
sWorld.SetClosed(true);
return true;
}
if (args == "off")
else if (strncmp(args, "off", 4) == 0)
{
SendSysMessage(LANG_WORLD_OPENED);
sWorld.SetClosed(false);
+1 -1
View File
@@ -2628,7 +2628,7 @@ void InstanceMap::CreateInstanceData(bool load)
{
Field* fields = result->Fetch();
const char* data = fields[0].GetString();
if (data && data != "")
if (data && (strncmp(data, "", 1) == 0))
{
sLog.outDebug("Loading instance data for `%s` with id %u", objmgr.GetScriptName(i_script_id), i_InstanceId);
i_data->Load(data);
+6 -2
View File
@@ -150,8 +150,12 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player)
InstanceGroupBind *groupBind = NULL;
Group *group = player->GetGroup();
// use the player's difficulty setting (it may not be the same as the group's)
if (group && (groupBind = group->GetBoundInstance(this)))
pSave = groupBind->save;
if (group)
{
groupBind = group->GetBoundInstance(this);
if (groupBind)
pSave = groupBind->save;
}
}
if (pSave)
{
+5 -3
View File
@@ -252,7 +252,7 @@ void ObjectAccessor::AddCorpsesToGrid(GridPair const& gridpair, GridType& grid,
}
}
Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia)
Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool /*insignia*/)
{
Corpse* corpse = GetCorpseForPlayerGUID(player_guid);
if (!corpse)
@@ -266,7 +266,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
DEBUG_LOG("Deleting Corpse and spawning bones.");
Map* map = corpse->FindMap();
//Map* map = corpse->FindMap();
// remove corpse from player_guid -> corpse map
RemoveCorpse(corpse);
@@ -285,6 +285,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
delete corpse;
return NULL;
/*
Corpse* bones = NULL;
// create the bones only if the map and the grid is loaded at the corpse's location
// ignore bones creating option in case insignia
@@ -323,9 +324,10 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
delete corpse;
return bones;
*/
}
void ObjectAccessor::Update(uint32 diff)
void ObjectAccessor::Update(uint32 /*diff*/)
{
UpdateDataMapType update_players;
+6 -5
View File
@@ -3392,7 +3392,7 @@ void ObjectMgr::LoadArenaTeams()
do
{
Field *fields = result->Fetch();
//Field *fields = result->Fetch();
bar.step();
++count;
@@ -5308,7 +5308,7 @@ void ObjectMgr::LoadAreaTriggerScripts()
uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 team)
{
bool found = false;
float dist;
float dist = 10000;
uint32 id = 0;
for (uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
@@ -5394,7 +5394,8 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt
CreatureInfo const *mount_info = GetCreatureTemplate(mount_entry);
if (mount_info)
{
if (! (mount_id = mount_info->GetRandomValidModelId()))
mount_id = mount_info->GetRandomValidModelId();
if (!mount_id)
{
sLog.outErrorDb("No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry);
return false;
@@ -5539,12 +5540,12 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float
// at corpse map
bool foundNear = false;
float distNear;
float distNear = 10000;
WorldSafeLocsEntry const* entryNear = NULL;
// at entrance map for corpse map
bool foundEntr = false;
float distEntr;
float distEntr = 10000;
WorldSafeLocsEntry const* entryEntr = NULL;
// some where other
+2 -2
View File
@@ -113,8 +113,8 @@ void OutdoorPvPHP::HandlePlayerLeaveZone(Player * plr, uint32 zone)
bool OutdoorPvPHP::Update(uint32 diff)
{
bool changed = false;
if (changed = OutdoorPvP::Update(diff))
bool changed = OutdoorPvP::Update(diff);
if (changed)
{
if (m_AllianceTowersControlled == 3)
TeamApplyBuff(TEAM_ALLIANCE, AllianceBuff, HordeBuff);
+2 -2
View File
@@ -120,9 +120,9 @@ void OPvPCapturePointTF::HandlePlayerLeave(Player *plr)
bool OutdoorPvPTF::Update(uint32 diff)
{
bool changed = false;
bool changed = OutdoorPvP::Update(diff);
if (changed = OutdoorPvP::Update(diff))
if (changed)
{
if (m_AllianceTowersControlled == TF_TOWER_NUM)
{
+2 -2
View File
@@ -126,8 +126,8 @@ void OPvPCapturePointZM_Beacon::SendChangePhase()
bool OutdoorPvPZM::Update(uint32 diff)
{
bool changed = false;
if (changed = OutdoorPvP::Update(diff))
bool changed = OutdoorPvP::Update(diff);
if (changed)
{
if (m_AllianceTowersControlled == ZM_NUM_BEACONS)
m_GraveYard->SetBeaconState(ALLIANCE);
+10 -9
View File
@@ -1600,7 +1600,8 @@ bool Player::BuildEnumData(QueryResult_AutoPtr result, WorldPacket * p_data)
if (!enchantId)
continue;
if ((enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId)))
enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId);
if (enchant)
break;
}
@@ -7262,7 +7263,8 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
// If set dpsMod in ScalingStatValue use it for min (70% from average), max (130% from average) damage
if (ssv)
{
if ((extraDPS = ssv->getDPSMod(proto->ScalingStatValue)))
extraDPS = ssv->getDPSMod(proto->ScalingStatValue);
if (extraDPS)
{
float average = extraDPS * proto->Delay / 1000.0f;
minDamage = 0.7f * average;
@@ -12172,7 +12174,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
{
uint8 msg;
ItemPosCountVec sDest;
uint16 eDest;
uint16 eDest = 0;
if (IsInventoryPos(dst))
msg = CanStoreItem(dstbag, dstslot, sDest, pSrcItem, false);
else if (IsBankPos (dst))
@@ -12216,7 +12218,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
}
// impossible merge/fill, do real swap
uint8 msg;
uint8 msg = EQUIP_ERR_OK;
// check src->dest move possibility
ItemPosCountVec sDest;
@@ -20707,11 +20709,8 @@ void Player::resetSpells(bool myClassOnly)
if (!clsEntry)
return;
family = clsEntry->spellfamily;
}
for (PlayerSpellMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter)
{
if (myClassOnly)
for (PlayerSpellMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(iter->first);
if (!spellInfo)
@@ -20738,8 +20737,10 @@ void Player::resetSpells(bool myClassOnly)
if (!SpellMgr::IsSpellValid(spellInfo,this,false))
continue;
}
removeSpell(iter->first,false,false); // only iter->first can be accessed, object by iter->second can be deleted already
}
else
for (PlayerSpellMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter)
removeSpell(iter->first,false,false); // only iter->first can be accessed, object by iter->second can be deleted already
learnDefaultSpells();
learnQuestRewardedSpells();
+4 -2
View File
@@ -709,12 +709,14 @@ void LoadOverridenSQLData()
GameObjectInfo *goInfo;
// Sunwell Plateau : Kalecgos : Spectral Rift
if (goInfo = GOBJECT(187055))
goInfo = GOBJECT(187055);
if (goInfo)
if (goInfo->type == GAMEOBJECT_TYPE_GOOBER)
goInfo->goober.lockId = 57; // need LOCKTYPE_QUICK_OPEN
// Naxxramas : Sapphiron Birth
if (goInfo = GOBJECT(181356))
goInfo = GOBJECT(181356);
if (goInfo)
if (goInfo->type == GAMEOBJECT_TYPE_TRAP)
goInfo->trap.radius = 50;
}
+7 -4
View File
@@ -1335,7 +1335,8 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
}
// Get Data Needed for Diminishing Returns, some effects may have multiple auras, so this must be done on spell hit, not aura add
if (m_diminishGroup = GetDiminishingReturnsGroupForSpell(m_spellInfo,m_triggeredByAuraSpell))
m_diminishGroup = GetDiminishingReturnsGroupForSpell(m_spellInfo,m_triggeredByAuraSpell);
if (m_diminishGroup)
{
m_diminishLevel = unit->GetDiminishing(m_diminishGroup);
DiminishingReturnsType type = GetDiminishingReturnsGroupType(m_diminishGroup);
@@ -1372,8 +1373,9 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
if (m_originalCaster)
{
if (m_spellAura = Aura::TryCreate(aurSpellInfo, effectMask, unit,
m_originalCaster,(aurSpellInfo == m_spellInfo)? &m_currentBasePoints[0] : &basePoints[0], m_CastItem))
m_spellAura = Aura::TryCreate(aurSpellInfo, effectMask, unit,
m_originalCaster,(aurSpellInfo == m_spellInfo)? &m_currentBasePoints[0] : &basePoints[0], m_CastItem);
if (m_spellAura)
{
// Now Reduce spell duration using data received at spell hit
int32 duration = m_spellAura->GetMaxDuration();
@@ -4584,7 +4586,8 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_targets.getTargetMask() == TARGET_FLAG_SELF &&
m_spellInfo->EffectImplicitTargetA[1] == TARGET_UNIT_TARGET_ENEMY)
{
if (target = m_caster->GetUnit(*m_caster, m_caster->ToPlayer()->GetSelection()))
target = m_caster->GetUnit(*m_caster, m_caster->ToPlayer()->GetSelection());
if (target)
m_targets.setUnitTarget(target);
else
return SPELL_FAILED_BAD_TARGETS;
+8 -5
View File
@@ -504,15 +504,18 @@ int32 AuraEffect::CalculateAmount(Unit * caster)
AuraEffect const* pAurEff;
// Borrowed Time
if (pAurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_PRIEST, 2899, 1))
pAurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_PRIEST, 2899, 1);
if (pAurEff)
bonus += (float)pAurEff->GetAmount() / 100.0f;
// Twin Disciplines
if (pAurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_PRIEST, 0x400000, 0, 0, caster->GetGUID()))
pAurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_PRIEST, 0x400000, 0, 0, caster->GetGUID());
if (pAurEff)
bonus += (float)pAurEff->GetAmount() / 100.0f;
// Focused Power
if (pAurEff = caster->GetAuraEffect(SPELL_AURA_MOD_HEALING_DONE_PERCENT, SPELLFAMILY_PRIEST, 2210, 2))
pAurEff = caster->GetAuraEffect(SPELL_AURA_MOD_HEALING_DONE_PERCENT, SPELLFAMILY_PRIEST, 2210, 2);
if (pAurEff)
bonus += (float)pAurEff->GetAmount() / 100.0f;
DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(GetSpellProto())) * bonus;
@@ -2053,7 +2056,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
if (target->GetPower(POWER_MANA) >= 10)
{
target->ModifyPower(POWER_MANA, -10);
target->SendEnergizeSpellLog(caster, 27746, -10, POWER_MANA);
target->SendEnergizeSpellLog(caster, 27746, 10, POWER_MANA);
}
else
target->RemoveAurasDueToSpell(27746);
@@ -3039,7 +3042,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
}
else
{
uint32 model_id;
uint32 model_id = 0;
if (uint32 modelid = ci->GetRandomValidModelId())
model_id = modelid; // Will use the default model here
+6 -3
View File
@@ -557,9 +557,12 @@ void Aura::UpdateOwner(uint32 diff, WorldObject * owner)
Spell * modSpell = NULL;
Player * modOwner = NULL;
if (caster)
if ((modOwner = caster->GetSpellModOwner())
&& (modSpell = modOwner->FindCurrentSpellBySpellId(GetId())))
modOwner->SetSpellModTakingSpell(modSpell, true);
{
modOwner = caster->GetSpellModOwner();
modSpell = modOwner->FindCurrentSpellBySpellId(GetId());
if (modOwner && modSpell)
modOwner->SetSpellModTakingSpell(modSpell, true);
}
Update(diff, caster);
+4 -2
View File
@@ -937,13 +937,15 @@ bool Guardian::UpdateStats(Stats stat)
// Ravenous Dead
AuraEffect const *aurEff;
// Check just if owner has Ravenous Dead since it's effect is not an aura
if (aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0))
aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0);
if (aurEff)
{
SpellEntry const* sProto = aurEff->GetSpellProto(); // Then get the SpellProto and add the dummy effect value
mod += mod * (sProto->EffectBasePoints[1] / 100.0f); // Ravenous Dead edits the original scale
}
// Glyph of the Ghoul
if (aurEff = owner->GetAuraEffect(58686, 0))
aurEff = owner->GetAuraEffect(58686, 0);
if (aurEff)
mod += (aurEff->GetAmount() / 100.0f); // Glyph of the Ghoul adds a flat value to the scale mod
value += float(owner->GetStat(stat)) * mod;
}
+1 -7
View File
@@ -249,16 +249,10 @@ void TempSummon::RemoveFromWorld()
return;
if (m_Properties)
{
if (uint32 slot = m_Properties->Slot)
{
if (Unit* owner = GetSummoner())
{
if (owner->m_SummonSlot[slot] = GetGUID())
if (owner->m_SummonSlot[slot] == GetGUID())
owner->m_SummonSlot[slot] = 0;
}
}
}
//if (GetOwnerGUID())
// sLog.outError("Unit %u has owner guid when removed from world", GetEntry());
+13 -10
View File
@@ -3631,8 +3631,8 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
}
bool auraStateFound = false;
AuraState auraState;
if (auraState = GetSpellAuraState(aura->GetSpellProto()))
AuraState auraState = GetSpellAuraState(aura->GetSpellProto());
if (auraState)
{
bool canBreak = false;
// Get mask of all aurastates from remaining auras
@@ -5950,7 +5950,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
if ((*i)->GetEffIndex() != 0)
continue;
basepoints0 = int32((*i)->GetAmount());
if (target = GetGuardianPet())
target = GetGuardianPet();
if (target)
{
// regen mana for pet
CastCustomSpell(target,54607,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
@@ -12111,10 +12112,10 @@ Unit* Creature::SelectVictim()
const AuraEffectList& tauntAuras = GetAuraEffectsByType(SPELL_AURA_MOD_TAUNT);
if (!tauntAuras.empty())
{
Unit* caster;
Unit* caster = tauntAuras.back()->GetCaster();
// The last taunt aura caster is alive an we are happy to attack him
if ((caster = tauntAuras.back()->GetCaster()) && caster->isAlive())
if (caster && caster->isAlive())
return getVictim();
else if (tauntAuras.size() > 1)
{
@@ -12126,8 +12127,8 @@ Unit* Creature::SelectVictim()
do
{
--aura;
if ((caster = (*aura)->GetCaster()) &&
caster->IsInMap(this) && canAttack(caster) && caster->isInAccessiblePlaceFor(this->ToCreature()))
caster = (*aura)->GetCaster();
if (caster && caster->IsInMap(this) && canAttack(caster) && caster->isInAccessiblePlaceFor(this->ToCreature()))
{
target = caster;
break;
@@ -12194,9 +12195,11 @@ Unit* Creature::SelectVictim()
// search nearby enemy before enter evade mode
if (HasReactState(REACT_AGGRESSIVE))
if (target = SelectNearestTarget())
if (_IsTargetAcceptable(target))
{
target = SelectNearestTarget();
if (target && _IsTargetAcceptable(target))
return target;
}
if (m_invisibilityMask)
{
@@ -13221,7 +13224,7 @@ void CharmInfo::InitCharmCreateSpells()
{
m_charmspells[x].SetActionAndType(spellId,ACT_DISABLED);
ActiveStates newstate;
ActiveStates newstate = ACT_PASSIVE;
if (spellInfo)
{
if (!IsAutocastableSpell(spellId))
+1 -1
View File
@@ -68,7 +68,7 @@ bool WaypointMovementGenerator<Player>::GetDestination(float & /*x*/, float & /*
}
template<>
void WaypointMovementGenerator<Creature>::Reset(Creature & /*unit*/unit)
void WaypointMovementGenerator<Creature>::Reset(Creature & /*unit*/)
{
StopedByPlayer = true;
i_nextMoveTime.Reset(0);
@@ -173,8 +173,8 @@ struct boss_vaelAI : public ScriptedAI
while (i < 3) // max 3 tries to get a random target with power_mana
{
++i;
if (pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) //not aggro leader
if (pTarget->getPowerType() == POWER_MANA)
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader
if (pTarget && pTarget->getPowerType() == POWER_MANA)
i = 3;
}
if (pTarget) // cast on self (see below)
@@ -1511,7 +1511,8 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
// Death
for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
{
if (!(pTemp = Unit::GetCreature(*me, uiGhoulGUID[i])))
pTemp = Unit::GetCreature(*me, uiGhoulGUID[i]);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_ACHERUS_GHOUL, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2084);
@@ -1520,7 +1521,8 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
}
for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
{
if (!(pTemp = Unit::GetCreature(*me, uiAbominationGUID[i])))
pTemp = Unit::GetCreature(*me, uiAbominationGUID[i]);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2084);
@@ -1529,7 +1531,8 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
}
for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
{
if (!(pTemp = Unit::GetCreature(*me, uiWarriorGUID[i])))
pTemp = Unit::GetCreature(*me, uiWarriorGUID[i]);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2084);
@@ -1538,7 +1541,8 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
}
for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
{
if (!(pTemp = Unit::GetCreature(*me, uiBehemothGUID[i])))
pTemp = Unit::GetCreature(*me, uiBehemothGUID[i]);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_FLESH_BEHEMOTH, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2084);
@@ -1549,7 +1553,8 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
// Dawn
for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i)
{
if (!(pTemp = Unit::GetCreature(*me, uiDefenderGUID[i])))
pTemp = Unit::GetCreature(*me, uiDefenderGUID[i]);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2089);
@@ -1559,7 +1564,8 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
}
for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i)
{
if (!(pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[i])))
pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[i]);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2089);
@@ -1567,28 +1573,32 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
uiEarthshatterGUID[i] = pTemp->GetGUID();
}
}
if (!(pTemp = Unit::GetCreature(*me, uiKorfaxGUID)))
pTemp = Unit::GetCreature(*me, uiKorfaxGUID);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
pTemp->setFaction(2089);
me->AddThreat(pTemp, 0.0f);
uiKorfaxGUID = pTemp->GetGUID();
}
if (!(pTemp = Unit::GetCreature(*me, uiMaxwellGUID)))
pTemp = Unit::GetCreature(*me, uiMaxwellGUID);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
pTemp->setFaction(2089);
me->AddThreat(pTemp, 0.0f);
uiMaxwellGUID = pTemp->GetGUID();
}
if (!(pTemp = Unit::GetCreature(*me, uiEligorGUID)))
pTemp = Unit::GetCreature(*me, uiEligorGUID);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
pTemp->setFaction(2089);
me->AddThreat(pTemp, 0.0f);
uiEligorGUID = pTemp->GetGUID();
}
if (!(pTemp = Unit::GetCreature(*me, uiRayneGUID)))
pTemp = Unit::GetCreature(*me, uiRayneGUID);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2089);
@@ -60,7 +60,7 @@ struct boss_azshir_the_sleeplessAI : public ScriptedAI
DoCast(me->getVictim(), SPELL_SOULSIPHON);
return;
SoulSiphon_Timer = 20000;
//SoulSiphon_Timer = 20000;
} else SoulSiphon_Timer -= diff;
}
@@ -116,12 +116,7 @@ static Locations Spawn[]=
{1765.28,1347.46,17.55} //spawn point for smoke
};
struct Summon
{
const std::string text;
};
static Summon Text[]=
static const char* Text[]=
{
{"Horseman rise..."},
{"Your time is nigh..."},
@@ -615,14 +610,14 @@ struct boss_headless_horsemanAI : public ScriptedAI
if (count < 3)
{
if (plr)
plr->Say(Text[count].text,0);
plr->Say(Text[count],0);
}
else
{
DoCast(me, SPELL_RHYME_BIG);
if (plr)
{
plr->Say(Text[count].text,0);
plr->Say(Text[count],0);
plr->HandleEmoteCommand(ANIM_EMOTE_SHOUT);
}
wp_reached = true;
@@ -559,11 +559,10 @@ struct boss_alyson_antilleAI : public boss_hexlord_addAI
else
{
if (urand(0,1))
{
if (pTarget = DoSelectLowestHpFriendly(50, 0))
DoCast(pTarget, SPELL_DISPEL_MAGIC, false);
}
else if (pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
pTarget = DoSelectLowestHpFriendly(50, 0);
else
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoCast(pTarget, SPELL_DISPEL_MAGIC, false);
}
flashheal_timer = 2500;
@@ -167,8 +167,8 @@ struct boss_marliAI : public ScriptedAI
while (i < 3) // max 3 tries to get a random target with power_mana
{
++i;
if (pTarget = SelectTarget(SELECT_TARGET_RANDOM,1, 100, true)) // not aggro leader
if (pTarget->getPowerType() == POWER_MANA)
pTarget = SelectTarget(SELECT_TARGET_RANDOM,1, 100, true); // not aggro leader
if (pTarget && pTarget->getPowerType() == POWER_MANA)
i = 3;
}
if (pTarget)
+12 -8
View File
@@ -688,15 +688,19 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
Fandral->CastSpell(-8127,1525,17.5,33806,true);
break;
case 51:
while (mob = plr->FindNearestCreature(15423,50,me))
mob->RemoveFromWorld();
while (mob = plr->FindNearestCreature(15424,50,me))
mob->RemoveFromWorld();
while (mob = plr->FindNearestCreature(15414,50,me))
mob->RemoveFromWorld();
while (mob = plr->FindNearestCreature(15422,50,me))
mob->RemoveFromWorld();
{
uint32 entries[4] = { 15423, 15424, 15414, 15422 };
for (uint8 i = 0; i < 4; ++i)
{
mob = plr->FindNearestCreature(entries[i],50,me);
while (mob)
{
mob->RemoveFromWorld();
mob = plr->FindNearestCreature(15423,50,me);
}
}
break;
}
case 52:
Fandral->GetMotionMaster()->MoveCharge(-8028.75, 1538.795, 2.61,4);
DoScriptText(ANACHRONOS_SAY_9, me,Fandral);
@@ -182,18 +182,26 @@ struct boss_krik_thirAI : public ScriptedAI
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
{
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, DONE);
//Achievement: Watch him die
Creature *pAdd1, *pAdd2, *pAdd3;
if ((pAdd1 = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_GASHRA))) && pAdd1->isAlive() &&
(pAdd2 = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_SILTHIK))) && pAdd2->isAlive() &&
(pAdd3 = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_NARJIL))) && pAdd3->isAlive() &&
IsHeroic())
pInstance->DoCompleteAchievement(ACHIEV_WATH_HIM_DIE);
}
if (!pInstance)
return;
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, DONE);
//Achievement: Watch him die
Creature *pAdd = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_GASHRA));
if (!pAdd || !pAdd->isAlive())
return;
pAdd = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_SILTHIK));
if (!pAdd || !pAdd->isAlive())
return;
pAdd = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_NARJIL));
if (!pAdd || !pAdd->isAlive())
return;
pInstance->DoCompleteAchievement(ACHIEV_WATH_HIM_DIE);
}
void KilledUnit(Unit * victim)
{
if (victim == me)
+50 -69
View File
@@ -647,6 +647,13 @@ enum eNesingwaryTrapper
SPELL_TRAPPED = 46104,
};
#define CaribouTrapsNum 15
const uint32 CaribouTraps[CaribouTrapsNum] =
{
GO_CARIBOU_TRAP_1, GO_CARIBOU_TRAP_2, GO_CARIBOU_TRAP_3, GO_CARIBOU_TRAP_4, GO_CARIBOU_TRAP_5,
GO_CARIBOU_TRAP_6, GO_CARIBOU_TRAP_7, GO_CARIBOU_TRAP_8, GO_CARIBOU_TRAP_9, GO_CARIBOU_TRAP_10,
GO_CARIBOU_TRAP_11, GO_CARIBOU_TRAP_12, GO_CARIBOU_TRAP_13, GO_CARIBOU_TRAP_14, GO_CARIBOU_TRAP_15,
};
//#define SAY_NESINGWARY_1 -1571008
struct npc_nesingwary_trapperAI : public ScriptedAI
@@ -725,24 +732,15 @@ struct npc_nesingwary_trapperAI : public ScriptedAI
case 7:
{
GameObject *go_caribou = NULL;
if ((go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_1, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_2, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_3, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_4, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_5, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_6, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_7, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_8, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_9, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_10, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_11, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_12, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_13, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_14, 5.0f)) ||
(go_caribou = me->FindNearestGameObject(GO_CARIBOU_TRAP_15, 5.0f)))
for (uint8 i = 0; i < CaribouTrapsNum; ++i)
{
go_caribou->SetGoState(GO_STATE_ACTIVE);
go_caribouGUID = go_caribou->GetGUID();
go_caribou = me->FindNearestGameObject(CaribouTraps[i], 5.0f);
if (go_caribou)
{
go_caribou->SetGoState(GO_STATE_ACTIVE);
go_caribouGUID = go_caribou->GetGUID();
break;
}
}
Phase = 8;
uiPhaseTimer = 1000;
@@ -2029,6 +2027,16 @@ enum eHelpThemselves
GO_MAMMOTH_TRAP_22 = 188044,
};
#define MammothTrapsNum 22
const uint32 MammothTraps[MammothTrapsNum] =
{
GO_MAMMOTH_TRAP_1, GO_MAMMOTH_TRAP_2, GO_MAMMOTH_TRAP_3, GO_MAMMOTH_TRAP_4, GO_MAMMOTH_TRAP_5,
GO_MAMMOTH_TRAP_6, GO_MAMMOTH_TRAP_7, GO_MAMMOTH_TRAP_8, GO_MAMMOTH_TRAP_9, GO_MAMMOTH_TRAP_10,
GO_MAMMOTH_TRAP_11, GO_MAMMOTH_TRAP_12, GO_MAMMOTH_TRAP_13, GO_MAMMOTH_TRAP_14, GO_MAMMOTH_TRAP_15,
GO_MAMMOTH_TRAP_16, GO_MAMMOTH_TRAP_17, GO_MAMMOTH_TRAP_18, GO_MAMMOTH_TRAP_19, GO_MAMMOTH_TRAP_20,
GO_MAMMOTH_TRAP_21, GO_MAMMOTH_TRAP_22
};
struct npc_trapped_mammoth_calfAI : public ScriptedAI
{
npc_trapped_mammoth_calfAI(Creature* c) : ScriptedAI(c) {}
@@ -2038,34 +2046,19 @@ struct npc_trapped_mammoth_calfAI : public ScriptedAI
void Reset()
{
GameObject *pTrap;
uiTimer = 1500;
bStarted = false;
if ((pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_1,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_2,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_3,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_4,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_5,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_6,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_7,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_8,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_9,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_10,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_11,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_12,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_13,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_14,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_15,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_16,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_17,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_18,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_19,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_20,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_21,1.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_22,1.0f)))
pTrap->SetGoState(GO_STATE_ACTIVE);
GameObject* pTrap;
for (uint8 i = 0; i < MammothTrapsNum; ++i)
{
pTrap = me->FindNearestGameObject(MammothTraps[i],11.0f);
if (pTrap)
{
pTrap->SetGoState(GO_STATE_ACTIVE);
return;
}
}
}
void UpdateAI(const uint32 diff)
@@ -2091,34 +2084,20 @@ struct npc_trapped_mammoth_calfAI : public ScriptedAI
void MovementInform(uint32 uiType, uint32 /*uiId*/)
{
GameObject* pTrap;
if (uiType != POINT_MOTION_TYPE)
return;
me->DisappearAndDie();
if ((pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_1,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_2,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_3,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_4,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_5,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_6,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_7,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_8,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_9,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_10,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_11,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_12,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_13,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_14,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_15,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_16,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_17,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_18,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_19,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_20,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_21,11.0f)) ||
(pTrap = me->FindNearestGameObject(GO_MAMMOTH_TRAP_22,11.0f)))
pTrap->SetLootState(GO_JUST_DEACTIVATED);
GameObject* pTrap;
for (uint8 i = 0; i < MammothTrapsNum; ++i)
{
pTrap = me->FindNearestGameObject(MammothTraps[i],11.0f);
if (pTrap)
{
pTrap->SetLootState(GO_JUST_DEACTIVATED);
return;
}
}
}
};
@@ -2233,8 +2212,10 @@ struct npc_valiance_keep_cannoneerAI : public ScriptedAI
if (uiTimer <= diff)
{
me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
GameObject* pCannon;
if ((pCannon = me->FindNearestGameObject(GO_VALIANCE_KEEP_CANNON_1,10)) || (pCannon = me->FindNearestGameObject(GO_VALIANCE_KEEP_CANNON_2,10)))
GameObject* pCannon = me->FindNearestGameObject(GO_VALIANCE_KEEP_CANNON_1,10);
if (!pCannon)
pCannon = me->FindNearestGameObject(GO_VALIANCE_KEEP_CANNON_2,10);
if (pCannon)
pCannon->Use(me);
uiTimer = urand(13000,18000);
}
+17 -14
View File
@@ -301,29 +301,32 @@ struct npc_alorah_and_grimminAI : public ScriptedAI
{
npc_alorah_and_grimminAI(Creature* pCreature) : ScriptedAI(pCreature) {}
uint8 uiCast;
bool uiCast;
void Reset()
{
uiCast = 1;
uiCast = false;
}
void UpdateAI(const uint32 /*uiDiff*/)
{
if (uiCast = 1)
if (uiCast)
return;
uiCast = true;
Creature* pTarget = NULL;
switch(me->GetEntry())
{
Creature* pTarget1 = me->FindNearestCreature(NPC_EYDIS_DARKBANE, 10.0f);
Creature* pTarget2 = me->FindNearestCreature(NPC_FJOLA_LIGHTBANE, 10.0f);
switch(me->GetEntry())
{
case NPC_PRIESTESS_ALORAH:
DoCast(pTarget1, SPELL_CHAIN);
uiCast = 0;
case NPC_PRIEST_GRIMMIN:
DoCast(pTarget2, SPELL_CHAIN);
uiCast = 0;
}
case NPC_PRIESTESS_ALORAH:
pTarget = me->FindNearestCreature(NPC_EYDIS_DARKBANE, 10.0f);
break;
case NPC_PRIEST_GRIMMIN:
pTarget = me->FindNearestCreature(NPC_FJOLA_LIGHTBANE, 10.0f);
break;
}
if (pTarget)
DoCast(pTarget, SPELL_CHAIN);
if (!UpdateVictim())
return;
}
@@ -286,7 +286,7 @@ struct instance_naxxramas : public InstanceData
}
}
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* source, Unit const* target = NULL, uint32 miscvalue1 = 0)
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target = NULL*/, uint32 /*miscvalue1 = 0*/)
{
switch(criteria_id)
{
@@ -1072,7 +1072,7 @@ struct mob_acolyte_of_shadronAI : public ScriptedAI
if (pInstance)
{
Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true);
Creature* pShadron = NULL;
Creature* pSartharion = Unit::GetCreature(*me, pInstance->GetData64(DATA_SARTHARION));
if (Creature* pShadron = Unit::GetCreature(*me, pInstance->GetData64(DATA_SHADRON)))
//if not solo figth, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT
@@ -197,7 +197,8 @@ struct boss_kelesethAI : public ScriptedAI
DoScriptText(SAY_SKELETONS, me);
for (uint8 i = 0; i < 5; ++i)
{
if (Skeleton = me->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
Skeleton = me->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
if (Skeleton)
{
Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
Skeleton->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY() , me->GetPositionZ());
@@ -103,17 +103,24 @@ struct boss_palehoofAI : public ScriptedAI
{
pInstance->SetData(DATA_GORTOK_PALEHOOF_EVENT, NOT_STARTED);
Creature* pTemp;
if ((pTemp = Unit::GetCreature((*me), pInstance->GetData64(DATA_MOB_FRENZIED_WORGEN))) && !pTemp->isAlive())
pTemp->Respawn();
if ((pTemp = Unit::GetCreature((*me), pInstance->GetData64(DATA_MOB_FEROCIOUS_RHINO))) && !pTemp->isAlive())
pTemp->Respawn();
if ((pTemp = Unit::GetCreature((*me), pInstance->GetData64(DATA_MOB_MASSIVE_JORMUNGAR))) && !pTemp->isAlive())
pTemp->Respawn();
if ((pTemp = Unit::GetCreature((*me), pInstance->GetData64(DATA_MOB_RAVENOUS_FURBOLG))) && !pTemp->isAlive())
Creature* pTemp = Unit::GetCreature((*me), pInstance->GetData64(DATA_MOB_FRENZIED_WORGEN));
if (pTemp && !pTemp->isAlive())
pTemp->Respawn();
if (GameObject* pGo = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GORTOK_PALEHOOF_SPHERE)))
pTemp = Unit::GetCreature((*me), pInstance->GetData64(DATA_MOB_FEROCIOUS_RHINO));
if (pTemp && !pTemp->isAlive())
pTemp->Respawn();
pTemp = Unit::GetCreature((*me), pInstance->GetData64(DATA_MOB_MASSIVE_JORMUNGAR));
if (pTemp && !pTemp->isAlive())
pTemp->Respawn();
pTemp = Unit::GetCreature((*me), pInstance->GetData64(DATA_MOB_RAVENOUS_FURBOLG));
if (pTemp && !pTemp->isAlive())
pTemp->Respawn();
GameObject* pGo = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GORTOK_PALEHOOF_SPHERE));
if (pGo)
{
pGo->SetGoState(GO_STATE_READY);
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
@@ -233,21 +233,24 @@ struct mob_frozen_orb_stalkerAI : public Scripted_NoMovementAI
void UpdateAI(const uint32 /*diff*/)
{
if (!spawned)
if (spawned)
return;
spawned = true;
if (!pInstance)
return;
Unit* pToravon = me->GetCreature(*me, pInstance->GetData64(DATA_TORAVON));
if (!pToravon)
return;
uint8 num_orbs = RAID_MODE(1, 3);
for (uint8 i=0; i<num_orbs; ++i)
{
Unit* pToravon;
if (pInstance && (pToravon = me->GetCreature(*me, pInstance->GetData64(DATA_TORAVON))))
{
uint8 num_orbs = RAID_MODE(1, 3);
for (uint8 i=0; i<num_orbs; ++i)
{
Position pos;
me->GetNearPoint(pToravon, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, 10.0f, 0.0f);
me->SetPosition(pos, true);
DoCast(me, SPELL_FROZEN_ORB_SUMMON);
}
}
spawned = true;
Position pos;
me->GetNearPoint(pToravon, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, 10.0f, 0.0f);
me->SetPosition(pos, true);
DoCast(me, SPELL_FROZEN_ORB_SUMMON);
}
}
};
@@ -274,7 +274,8 @@ struct instance_violet_hold : public ScriptedInstance
{
case BOSS_MORAGG:
HandleGameObject(uiMoraggCell,bForceRespawn);
if (pBoss = instance->GetCreature(uiMoragg))
pBoss = instance->GetCreature(uiMoragg);
if (pBoss)
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
break;
case BOSS_EREKEM:
@@ -282,7 +283,8 @@ struct instance_violet_hold : public ScriptedInstance
HandleGameObject(uiErekemRightGuardCell, bForceRespawn);
HandleGameObject(uiErekemLeftGuardCell, bForceRespawn);
if (pBoss = instance->GetCreature(uiErekem))
pBoss = instance->GetCreature(uiErekem);
if (pBoss)
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
if (Creature* pGuard1 = instance->GetCreature(uiErekemGuard[0]))
@@ -303,22 +305,26 @@ struct instance_violet_hold : public ScriptedInstance
break;
case BOSS_ICHORON:
HandleGameObject(uiIchoronCell,bForceRespawn);
if (pBoss = instance->GetCreature(uiIchoron))
instance->GetCreature(uiIchoron);
if (pBoss)
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
break;
case BOSS_LAVANTHOR:
HandleGameObject(uiLavanthorCell,bForceRespawn);
if (pBoss = instance->GetCreature(uiLavanthor))
pBoss = instance->GetCreature(uiLavanthor);
if (pBoss)
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
break;
case BOSS_XEVOZZ:
HandleGameObject(uiXevozzCell,bForceRespawn);
if (pBoss = instance->GetCreature(uiXevozz))
pBoss = instance->GetCreature(uiXevozz);
if (pBoss)
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
break;
case BOSS_ZURAMAT:
HandleGameObject(uiZuramatCell,bForceRespawn);
if (pBoss = instance->GetCreature(uiZuramat))
pBoss = instance->GetCreature(uiZuramat);
if (pBoss)
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
break;
}
@@ -88,7 +88,7 @@ struct boss_murmurAI : public ScriptedAI
// Sonic Boom instant damage (needs core fix instead of this)
void SpellHitTarget(Unit *pTarget, const SpellEntry *spell)
{
if (pTarget && pTarget->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT)
if (pTarget && pTarget->isAlive() && spell && spell->Id == uint32(SPELL_SONIC_BOOM_EFFECT))
me->DealDamage(pTarget,(pTarget->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell);
}
@@ -220,15 +220,16 @@ struct mob_illidari_councilAI : public ScriptedAI
Creature* pMember = NULL;
for (uint8 i = 0; i < 4; ++i)
{
if (pMember = (Unit::GetCreature((*me), Council[i])))
pMember = Unit::GetCreature((*me), Council[i]);
if (!pMember)
continue;
if (!pMember->isAlive())
{
if (!pMember->isAlive())
{
pMember->RemoveCorpse();
pMember->Respawn();
}
pMember->AI()->EnterEvadeMode();
pMember->RemoveCorpse();
pMember->Respawn();
}
pMember->AI()->EnterEvadeMode();
}
if (pInstance)
@@ -204,7 +204,7 @@ struct boss_leotheras_the_blindAI : public ScriptedAI
pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED);
}
void CheckChannelers(bool DoEvade = true)
void CheckChannelers(/*bool DoEvade = true*/)
{
for (uint8 i = 0; i < 3; ++i)
{
@@ -646,7 +646,7 @@ struct mob_greyheart_spellbinderAI : public ScriptedAI
pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0);
Creature *leotheras = Unit::GetCreature(*me, leotherasGUID);
if (leotheras && leotheras->isAlive())
CAST_AI(boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(false);
CAST_AI(boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(/*false*/);
}
}
@@ -98,7 +98,7 @@ struct boss_nazanAI : public ScriptedAI
void SpellHitTarget(Unit *pTarget, const SpellEntry* entry)
{
if (pTarget && entry->Id == SPELL_FIREBALL)
if (pTarget && entry->Id == uint32(SPELL_FIREBALL))
me->SummonCreature(ENTRY_LIQUID_FIRE,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),pTarget->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,30000);
}
@@ -260,13 +260,18 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI
if (summoned)
{
Creature *Nazan = Unit::GetCreature(*me, NazanGUID);
Creature *Vazruden = Unit::GetCreature(*me, VazrudenGUID);
if (Nazan || (Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000)))
if (!Nazan)
Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000);
if (Nazan)
{
Nazan->DisappearAndDie();
NazanGUID = 0;
}
if (Vazruden || (Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000)))
Creature *Vazruden = Unit::GetCreature(*me, VazrudenGUID);
if (!Vazruden)
Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000);
if (Vazruden)
{
Vazruden->DisappearAndDie();
VazrudenGUID = 0;
+69 -50
View File
@@ -635,35 +635,37 @@ enum eJotunheimCage
bool GOHello_go_jotunheim_cage(Player* pPlayer, GameObject* pGO)
{
Creature* pPrisoner;
pPrisoner = NULL;
if ((pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true)) ||
(pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true)) ||
(pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true)) ||
(pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true)))
Creature* pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true);
if (!pPrisoner)
{
if (pPrisoner && pPrisoner->isAlive())
pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true);
if (!pPrisoner)
{
pPrisoner->DisappearAndDie();
pPlayer->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN, 0);
switch(pPrisoner->GetEntry())
{
case NPC_EBON_BLADE_PRISONER_HUMAN:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_H,true);
break;
case NPC_EBON_BLADE_PRISONER_NE:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_NE,true);
break;
case NPC_EBON_BLADE_PRISONER_TROLL:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_TROLL,true);
break;
case NPC_EBON_BLADE_PRISONER_ORC:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_ORC,true);
break;
}
pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true);
if (!pPrisoner)
pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true);
}
}
if (!pPrisoner || !pPrisoner->isAlive())
return false;
pPrisoner->DisappearAndDie();
pPlayer->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN, 0);
switch(pPrisoner->GetEntry())
{
case NPC_EBON_BLADE_PRISONER_HUMAN:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_H,true);
break;
case NPC_EBON_BLADE_PRISONER_NE:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_NE,true);
break;
case NPC_EBON_BLADE_PRISONER_TROLL:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_TROLL,true);
break;
case NPC_EBON_BLADE_PRISONER_ORC:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_ORC,true);
break;
}
return true;
}
enum eTableTheka
@@ -758,14 +760,26 @@ enum ePrisonersOfWyrmskull
bool GOHello_go_dragonflayer_cage(Player *pPlayer, GameObject *pGO)
{
Creature *pPrisoner = NULL;
Quest const* qInfo = objmgr.GetQuestTemplate(QUEST_PRISONERS_OF_WYRMSKULL);
if (pPlayer->GetQuestStatus(QUEST_PRISONERS_OF_WYRMSKULL) != QUEST_STATUS_INCOMPLETE)
return true;
if (pPlayer->GetQuestStatus(QUEST_PRISONERS_OF_WYRMSKULL) == QUEST_STATUS_INCOMPLETE &&
((pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PRIEST,2.0f)) ||
(pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_MAGE,2.0f)) ||
(pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_WARRIOR,2.0f)) ||
(pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PALADIN,2.0f))) && pPrisoner->isAlive())
Creature* pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PRIEST, 2.0f);
if (!pPrisoner)
{
pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_MAGE, 2.0f);
if (!pPrisoner)
{
pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_WARRIOR, 2.0f);
if (!pPrisoner)
pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PALADIN, 2.0f);
}
}
if (!pPrisoner || !pPrisoner->isAlive())
return true;
Quest const* qInfo = objmgr.GetQuestTemplate(QUEST_PRISONERS_OF_WYRMSKULL);
if (qInfo)
{
//TODO: prisoner should help player for a short period of time
pPlayer->KilledMonsterCredit(qInfo->ReqCreatureOrGOId[0],0);
@@ -787,15 +801,17 @@ enum eTadpoles
bool GOHello_go_tadpole_cage(Player *pPlayer, GameObject *pGO)
{
Creature *pTadpole;
if (pPlayer->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) == QUEST_STATUS_INCOMPLETE &&
(pTadpole = pGO->FindNearestCreature(NPC_WINTERFIN_TADPOLE,1.0f)))
if (pPlayer->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) == QUEST_STATUS_INCOMPLETE)
{
Creature *pTadpole = pGO->FindNearestCreature(NPC_WINTERFIN_TADPOLE,1.0f);
if (pTadpole)
{
pGO->UseDoorOrButton();
pTadpole->DisappearAndDie();
pPlayer->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE,0);
//FIX: Summon minion tadpole
}
}
return true;
}
@@ -814,14 +830,18 @@ enum eReallyDoneItThisTime
bool GOHello_go_black_cage(Player *pPlayer, GameObject *pGO)
{
Creature *pPrisoner;
if (((pPlayer->GetTeamId() == TEAM_ALLIANCE && pPlayer->GetQuestStatus(QUEST_ALLIANCE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE) ||
(pPlayer->GetTeamId() == TEAM_HORDE && pPlayer->GetQuestStatus(QUEST_HORDE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE)) &&
((pPrisoner = pGO->FindNearestCreature(NPC_CAPTIVE_ASPIRANT,1.0f)) || (pPrisoner = pGO->FindNearestCreature(NPC_KUL,1.0f))))
if ((pPlayer->GetTeamId() == TEAM_ALLIANCE && pPlayer->GetQuestStatus(QUEST_ALLIANCE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE) ||
(pPlayer->GetTeamId() == TEAM_HORDE && pPlayer->GetQuestStatus(QUEST_HORDE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE))
{
pGO->UseDoorOrButton();
pPrisoner->DisappearAndDie();
pPlayer->KilledMonsterCredit(pPrisoner->GetEntry(),0);
Creature *pPrisoner = pGO->FindNearestCreature(NPC_CAPTIVE_ASPIRANT,1.0f);
if (!pPrisoner)
pPrisoner = pGO->FindNearestCreature(NPC_KUL,1.0f);
if (pPrisoner)
{
pGO->UseDoorOrButton();
pPrisoner->DisappearAndDie();
pPlayer->KilledMonsterCredit(pPrisoner->GetEntry(),0);
}
}
return true;
}
@@ -893,14 +913,13 @@ enum eProphecy
bool GOHello_go_stillpine_cage(Player *pPlayer, GameObject *pGO)
{
Creature *pPrisoner;
if (pPlayer->GetQuestStatus(QUEST_PROPHECY_OF_AKIDA) == QUEST_STATUS_INCOMPLETE &&
(pPrisoner = pGO->FindNearestCreature(NPC_STILLPINE_CAPTIVE,1.0f)))
{
pGO->UseDoorOrButton();
pPrisoner->DisappearAndDie();
pPlayer->KilledMonsterCredit(pPrisoner->GetEntry(),0);
}
if (pPlayer->GetQuestStatus(QUEST_PROPHECY_OF_AKIDA) == QUEST_STATUS_INCOMPLETE)
if (Creature *pPrisoner = pGO->FindNearestCreature(NPC_STILLPINE_CAPTIVE,1.0f))
{
pGO->UseDoorOrButton();
pPrisoner->DisappearAndDie();
pPlayer->KilledMonsterCredit(pPrisoner->GetEntry(),0);
}
return true;
}
+58 -57
View File
@@ -253,36 +253,40 @@ enum ePileFakeFur
GO_HIGH_QUALITY_FUR = 187983,
NPC_NESINGWARY_TRAPPER = 25835
};
#define CaribouTrapsNum 15
const uint32 CaribouTraps[CaribouTrapsNum] =
{
GO_CARIBOU_TRAP_1, GO_CARIBOU_TRAP_2, GO_CARIBOU_TRAP_3, GO_CARIBOU_TRAP_4, GO_CARIBOU_TRAP_5,
GO_CARIBOU_TRAP_6, GO_CARIBOU_TRAP_7, GO_CARIBOU_TRAP_8, GO_CARIBOU_TRAP_9, GO_CARIBOU_TRAP_10,
GO_CARIBOU_TRAP_11, GO_CARIBOU_TRAP_12, GO_CARIBOU_TRAP_13, GO_CARIBOU_TRAP_14, GO_CARIBOU_TRAP_15,
};
bool ItemUse_item_pile_fake_furs(Player *pPlayer, Item * /*pItem*/, SpellCastTargets const & /*targets*/)
{
GameObject *pGo;
if ((pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_1, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_2, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_3, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_4, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_5, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_6, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_7, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_8, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_9, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_10, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_11, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_12, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_13, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_14, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_15, 5.0f)))
GameObject *pGo = NULL;
for (uint8 i = 0; i < CaribouTrapsNum; ++i)
{
if (pGo->FindNearestCreature(NPC_NESINGWARY_TRAPPER, 10.0f, true) || pGo->FindNearestCreature(NPC_NESINGWARY_TRAPPER, 10.0f, false) || pGo->FindNearestGameObject(GO_HIGH_QUALITY_FUR, 2.0f))
return true;
float x, y, z;
pGo->GetClosePoint(x, y, z, pGo->GetObjectSize() / 3, 7.0f);
pGo->SummonGameObject(GO_HIGH_QUALITY_FUR, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), 0, 0, 0, 0, 0, 1000);
if (TempSummon* summon = pPlayer->SummonCreature(NPC_NESINGWARY_TRAPPER, x, y, z, pGo->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 1000))
{
summon->SetVisibility(VISIBILITY_OFF);
summon->SetReactState(REACT_PASSIVE);
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
pGo = pPlayer->FindNearestGameObject(CaribouTraps[i], 5.0f);
if (pGo)
break;
}
if (!pGo)
return false;
if (pGo->FindNearestCreature(NPC_NESINGWARY_TRAPPER, 10.0f, true) || pGo->FindNearestCreature(NPC_NESINGWARY_TRAPPER, 10.0f, false) || pGo->FindNearestGameObject(GO_HIGH_QUALITY_FUR, 2.0f))
return true;
float x, y, z;
pGo->GetClosePoint(x, y, z, pGo->GetObjectSize() / 3, 7.0f);
pGo->SummonGameObject(GO_HIGH_QUALITY_FUR, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), 0, 0, 0, 0, 0, 1000);
if (TempSummon* summon = pPlayer->SummonCreature(NPC_NESINGWARY_TRAPPER, x, y, z, pGo->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 1000))
{
summon->SetVisibility(VISIBILITY_OFF);
summon->SetReactState(REACT_PASSIVE);
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
return false;
}
@@ -348,41 +352,38 @@ enum eHelpThemselves
GO_MAMMOTH_TRAP_22 = 188044,
};
#define MammothTrapsNum 22
const uint32 MammothTraps[MammothTrapsNum] =
{
GO_MAMMOTH_TRAP_1, GO_MAMMOTH_TRAP_2, GO_MAMMOTH_TRAP_3, GO_MAMMOTH_TRAP_4, GO_MAMMOTH_TRAP_5,
GO_MAMMOTH_TRAP_6, GO_MAMMOTH_TRAP_7, GO_MAMMOTH_TRAP_8, GO_MAMMOTH_TRAP_9, GO_MAMMOTH_TRAP_10,
GO_MAMMOTH_TRAP_11, GO_MAMMOTH_TRAP_12, GO_MAMMOTH_TRAP_13, GO_MAMMOTH_TRAP_14, GO_MAMMOTH_TRAP_15,
GO_MAMMOTH_TRAP_16, GO_MAMMOTH_TRAP_17, GO_MAMMOTH_TRAP_18, GO_MAMMOTH_TRAP_19, GO_MAMMOTH_TRAP_20,
GO_MAMMOTH_TRAP_21, GO_MAMMOTH_TRAP_22
};
bool ItemUse_item_dehta_trap_smasher(Player* pPlayer, Item* /*pItem*/, const SpellCastTargets & /*pTargets*/)
{
if (pPlayer->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE)
return false;
Creature* pMammoth;
pMammoth = pPlayer->FindNearestCreature(NPC_TRAPPED_MAMMOTH_CALF,5.0f);
if (!pMammoth)
return false;
GameObject* pTrap;
if (pPlayer->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) == QUEST_STATUS_INCOMPLETE &&
(pMammoth = pPlayer->FindNearestCreature(NPC_TRAPPED_MAMMOTH_CALF,5.0f)) &&
((pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_1,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_2,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_3,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_4,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_5,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_6,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_7,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_8,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_9,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_10,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_11,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_12,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_13,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_14,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_15,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_16,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_17,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_18,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_19,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_20,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_21,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_22,5.0f))))
for (uint8 i = 0; i < MammothTrapsNum; ++i)
{
pMammoth->AI()->DoAction(1);
pTrap->SetGoState(GO_STATE_READY);
pPlayer->KilledMonsterCredit(NPC_TRAPPED_MAMMOTH_CALF,0);
}
pTrap = pPlayer->FindNearestGameObject(MammothTraps[i],11.0f);
if (pTrap)
{
pMammoth->AI()->DoAction(1);
pTrap->SetGoState(GO_STATE_READY);
pPlayer->KilledMonsterCredit(NPC_TRAPPED_MAMMOTH_CALF,0);
return true;
}
}
return false;
}