Core/Spells: Fixed bad Z coordinate for Spell::EffectBind with location stored in database

Core/Scripts: Corrected few mistakes in misc scripts

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-12-03 13:54:00 +01:00
parent bd4b47af0e
commit 3badf69b63
4 changed files with 22 additions and 23 deletions
+2 -2
View File
@@ -7037,7 +7037,7 @@ void Spell::EffectBind(SpellEffIndex effIndex)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return; return;
Player* player = (Player*)unitTarget; Player* player = unitTarget->ToPlayer();
uint32 area_id; uint32 area_id;
WorldLocation loc; WorldLocation loc;
@@ -7053,7 +7053,7 @@ void Spell::EffectBind(SpellEffIndex effIndex)
loc.m_mapId = st->target_mapId; loc.m_mapId = st->target_mapId;
loc.m_positionX = st->target_X; loc.m_positionX = st->target_X;
loc.m_positionY = st->target_Y; loc.m_positionY = st->target_Y;
loc.m_positionZ = st->target_Y; loc.m_positionZ = st->target_Z;
loc.m_orientation = st->target_Orientation; loc.m_orientation = st->target_Orientation;
area_id = player->GetAreaId(); area_id = player->GetAreaId();
} }
@@ -530,22 +530,22 @@ class mob_essence_of_twin : public CreatureScript
public: public:
mob_essence_of_twin() : CreatureScript("mob_essence_of_twin") { } mob_essence_of_twin() : CreatureScript("mob_essence_of_twin") { }
bool OnGossipHello(Player* pPlayer, Creature* pCreature) bool OnGossipHello(Player* player, Creature* creature)
{ {
switch(pCreature->GetEntry()) switch (creature->GetEntry())
{ {
case NPC_LIGHT_ESSENCE: case NPC_LIGHT_ESSENCE:
if (pPlayer || pPlayer->HasAura(SPELL_DARK_ESSENCE)) player->RemoveAura(SPELL_DARK_ESSENCE);
pPlayer->RemoveAura(SPELL_DARK_ESSENCE); player->CastSpell(player, SPELL_LIGHT_ESSENCE, true);
pPlayer->CastSpell(pPlayer,SPELL_LIGHT_ESSENCE,true);
break; break;
case NPC_DARK_ESSENCE: case NPC_DARK_ESSENCE:
if (pPlayer || pPlayer->HasAura(SPELL_LIGHT_ESSENCE)) player->RemoveAura(SPELL_LIGHT_ESSENCE);
pPlayer->RemoveAura(SPELL_LIGHT_ESSENCE); player->CastSpell(player, SPELL_DARK_ESSENCE, true);
pPlayer->CastSpell(pPlayer,SPELL_DARK_ESSENCE,true); break;
default:
break; break;
} }
pPlayer->CLOSE_GOSSIP_MENU(); player->CLOSE_GOSSIP_MENU();
return true; return true;
} }
}; };
@@ -90,7 +90,7 @@ public:
uiYoggSaronGUID = 0; uiYoggSaronGUID = 0;
uiAlgalonGUID = 0; uiAlgalonGUID = 0;
uiKologarnChestGUID = 0; uiKologarnChestGUID = 0;
uiKologarnChestGUID = 0; uiThorimChestGUID = 0;
uiHodirChestGUID = 0; uiHodirChestGUID = 0;
uiFreyaChestGUID = 0; uiFreyaChestGUID = 0;
uiLeviathanGateGUID = 0; uiLeviathanGateGUID = 0;
+6 -7
View File
@@ -127,15 +127,14 @@ class item_nether_wraith_beacon : public ItemScript
public: public:
item_nether_wraith_beacon() : ItemScript("item_nether_wraith_beacon") { } item_nether_wraith_beacon() : ItemScript("item_nether_wraith_beacon") { }
bool OnUse(Player* pPlayer, Item* /*pItem*/, SpellCastTargets const& /*targets*/) bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& /*targets*/)
{ {
if (pPlayer->GetQuestStatus(10832) == QUEST_STATUS_INCOMPLETE) if (player->GetQuestStatus(10832) == QUEST_STATUS_INCOMPLETE)
{ {
Creature *Nether; if (Creature *nether = player->SummonCreature(22408, pPlayer->GetPositionX(), pPlayer->GetPositionY()+20, pPlayer->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000))
Nether = pPlayer->SummonCreature(22408, pPlayer->GetPositionX(), pPlayer->GetPositionY()+20, pPlayer->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000); nether->AI()->AttackStart(player);
Nether = pPlayer->SummonCreature(22408, pPlayer->GetPositionX(), pPlayer->GetPositionY()-20, pPlayer->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000); if (Creature *nether = player->SummonCreature(22408, pPlayer->GetPositionX(), pPlayer->GetPositionY()-20, pPlayer->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000))
if (Nether) nether->AI()->AttackStart(player);
Nether->AI()->AttackStart(pPlayer);
} }
return false; return false;
} }