Scripts/Serpentshrine Cavern: Fixed "The Lurker Above" achievement and removed hacks for the event
--HG-- branch : trunk
This commit is contained in:
@@ -1040,6 +1040,14 @@ void GameObject::Use(Unit* user)
|
||||
uint32 spellId = 0;
|
||||
bool triggered = false;
|
||||
|
||||
if (Player* playerUser = user->ToPlayer())
|
||||
{
|
||||
if (sScriptMgr->OnGossipHello(playerUser, this))
|
||||
return;
|
||||
|
||||
AI()->GossipHello(playerUser);
|
||||
}
|
||||
|
||||
switch(GetGoType())
|
||||
{
|
||||
case GAMEOBJECT_TYPE_DOOR: //0
|
||||
@@ -1238,15 +1246,14 @@ void GameObject::Use(Unit* user)
|
||||
//fishing bobber
|
||||
case GAMEOBJECT_TYPE_FISHINGNODE: //17
|
||||
{
|
||||
if (user->GetTypeId() != TYPEID_PLAYER)
|
||||
Player* player = user->ToPlayer();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
Player* player = (Player*)user;
|
||||
|
||||
if (player->GetGUID() != GetOwnerGUID())
|
||||
return;
|
||||
|
||||
switch(getLootState())
|
||||
switch (getLootState())
|
||||
{
|
||||
case GO_READY: // ready for loot
|
||||
{
|
||||
|
||||
@@ -294,11 +294,6 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recv_data)
|
||||
if (!obj)
|
||||
return;
|
||||
|
||||
if (sScriptMgr->OnGossipHello(_player, obj))
|
||||
return;
|
||||
|
||||
obj->AI()->GossipHello(_player);
|
||||
|
||||
obj->Use(_player);
|
||||
}
|
||||
|
||||
|
||||
@@ -2631,12 +2631,19 @@ void Spell::EffectEnergizePct(SpellEffIndex effIndex)
|
||||
|
||||
void Spell::SendLoot(uint64 guid, LootType loottype)
|
||||
{
|
||||
Player* player = (Player*)m_caster;
|
||||
Player* player = m_caster->ToPlayer();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
if (gameObjTarget)
|
||||
{
|
||||
// special case, already has GossipHello inside so return and avoid calling twice
|
||||
if (gameObjTarget->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
|
||||
{
|
||||
gameObjTarget->Use(m_caster);
|
||||
return;
|
||||
}
|
||||
|
||||
if (sScriptMgr->OnGossipHello(player, gameObjTarget))
|
||||
return;
|
||||
|
||||
@@ -2662,10 +2669,6 @@ void Spell::SendLoot(uint64 guid, LootType loottype)
|
||||
gameObjTarget->TriggeringLinkedGameObject(trapEntry,m_caster);
|
||||
return;
|
||||
|
||||
case GAMEOBJECT_TYPE_GOOBER:
|
||||
gameObjTarget->Use(m_caster);
|
||||
return;
|
||||
|
||||
case GAMEOBJECT_TYPE_CHEST:
|
||||
// TODO: possible must be moved to loot release (in different from linked triggering)
|
||||
if (gameObjTarget->GetGOInfo()->chest.eventId)
|
||||
|
||||
Reference in New Issue
Block a user