diff options
author | raczman <none@none> | 2009-04-04 00:30:45 +0200 |
---|---|---|
committer | raczman <none@none> | 2009-04-04 00:30:45 +0200 |
commit | ca916cebbea0fc16f5fe155508575ddfddc29f21 (patch) | |
tree | 2e580815e39734dd3bf89558248fa58ddc37f12c /src | |
parent | 38d634a1632720fb1ff596f43e988b1b6014ae82 (diff) | |
parent | 19f725cd5127a565850d9de28ec5f12bf5af4e33 (diff) |
merge with megamage's
<3
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp | 55 | ||||
-rw-r--r-- | src/game/Map.cpp | 7 |
2 files changed, 37 insertions, 25 deletions
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp index 7c035699a49..b720eb946d6 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp @@ -211,6 +211,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI npc_thrall_old_hillsbradAI(Creature *c) : npc_escortAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); + m_creature->setActive(true); } ScriptedInstance *pInstance; @@ -357,32 +358,39 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI //trigger epoch Yell("Thrall! Come outside and face your fate! ....") //from here, thrall should not never be allowed to move to point 106 which he currently does. break; - case 106: - if (!PlayerGUID) - break; - //trigger taretha to run down outside - if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) + case 106: { - if (Creature* Taretha = ((Creature*)Unit::GetUnit(*m_creature, TarethaGUID))) - ((npc_escortAI*)(Taretha->AI()))->Start(false, false, true, PlayerGUID); - } + if (!PlayerGUID) + break; - //kill credit creature for quest - Map *map = m_creature->GetMap(); - Map::PlayerList const& players = map->GetPlayers(); - if (!players.isEmpty() && map->IsDungeon()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + //trigger taretha to run down outside + if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) { - if (Player* pPlayer = itr->getSource()) - pPlayer->KilledMonster(20156,m_creature->GetGUID()); + if (Creature* Taretha = ((Creature*)Unit::GetUnit(*m_creature, TarethaGUID))) + ((npc_escortAI*)(Taretha->AI()))->Start(false, false, true, PlayerGUID); } - } - //alot will happen here, thrall and taretha talk, erozion appear at spot to explain - m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000); - break; + //kill credit creature for quest + Map *map = m_creature->GetMap(); + Map::PlayerList const& players = map->GetPlayers(); + if (!players.isEmpty() && map->IsDungeon()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + pPlayer->KilledMonster(20156,m_creature->GetGUID()); + } + } + + //alot will happen here, thrall and taretha talk, erozion appear at spot to explain + m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000); + } + break; + case 108: + //last waypoint, just set Thrall invisible, respawn is turned off + m_creature->SetVisibility(VISIBILITY_OFF); + break; } } @@ -711,6 +719,9 @@ bool GossipSelect_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature, DoScriptText(SAY_TH_START_EVENT_PART1, _Creature); ((npc_escortAI*)(_Creature->AI()))->Start(true, true, true, player->GetGUID()); + ((npc_escortAI*)(_Creature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far + ((npc_escortAI*)(_Creature->AI()))->SetDespawnAtEnd(false); + ((npc_escortAI*)(_Creature->AI()))->SetDespawnAtFar(false); break; case GOSSIP_ACTION_INFO_DEF+2: @@ -817,8 +828,8 @@ bool GossipSelect_npc_taretha(Player *player, Creature *_Creature, uint32 sender if( pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS ) { pInstance->SetData(TYPE_THRALL_PART4,IN_PROGRESS); - if(pInstance->GetData64(DATA_EPOCH) == 0) - _Creature->SummonCreature(ENTRY_EPOCH,2639.13,698.55,65.43,4.59,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000); + if(pInstance->GetData64(DATA_EPOCH) == 0) + _Creature->SummonCreature(ENTRY_EPOCH,2639.13,698.55,65.43,4.59,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000); if (uint64 ThrallGUID = pInstance->GetData64(DATA_THRALL)) { diff --git a/src/game/Map.cpp b/src/game/Map.cpp index ebe6c8c3061..669baf275f8 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -377,12 +377,14 @@ void Map::AddNotifier(T*) template<> void Map::AddNotifier(Player* obj) { + obj->m_IsInNotifyList = false; AddUnitToNotify(obj); } template<> void Map::AddNotifier(Creature* obj) { + obj->m_IsInNotifyList = false; AddUnitToNotify(obj); } @@ -468,8 +470,6 @@ bool Map::Add(Player *player) SendInitSelf(player); SendInitTransports(player); - player->m_IsInNotifyList = false; - player->m_Notified = false; player->m_clientGUIDs.clear(); AddNotifier(player); @@ -624,10 +624,11 @@ void Map::RelocationNotify() for(std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter) { Unit *unit = *iter; + unit->m_IsInNotifyList = false; + if(!unit->IsInWorld() || unit->GetMapId() != GetId()) continue; - unit->m_IsInNotifyList = false; unit->m_Notified = true; if(unit->GetTypeId() == TYPEID_PLAYER) |