void InnkeeperTrain(Player* pPlayer, Unit* pUnit) { if(pUnit->getEntry() == 6826) { QuestLogEntry* qle = pPlayer->GetQuestLogForEntry(8355); if(qle == NULL) return; qle->SetMobCount(0, qle->GetMobCount(0) + 1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } else if(pUnit->getEntry() == 11814) { QuestLogEntry* qle = pPlayer->GetQuestLogForEntry(8358); if(qle == NULL) return; qle->SetMobCount(0, qle->GetMobCount(0) + 1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } }
void InnkeeperDance(Player* pPlayer, Unit* pUnit) { if(pUnit->GetEntry() == 6735) { QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(8357); if(qle == NULL) return; qle->SetMobCount(0, qle->GetMobCount(0)+1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } else if(pUnit->GetEntry() == 6746) { QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(8360); if(qle == NULL) return; qle->SetMobCount(0, qle->GetMobCount(0)+1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } }
void InnkeeperChicken(Player* pPlayer, Unit* pUnit) { if(pUnit->getEntry() == 5111) { QuestLogEntry* qle = pPlayer->GetQuestLogForEntry(8353); if(qle == NULL) return; qle->SetMobCount(0, qle->GetMobCount(0) + 1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } else if(pUnit->getEntry() == 6741) { QuestLogEntry* qle = pPlayer->GetQuestLogForEntry(8354); if(qle == NULL) return; qle->SetMobCount(0, qle->GetMobCount(0) + 1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } }
void OnDied(Unit *mKiller) { if(mKiller->GetTypeId() != TYPEID_PLAYER) return; QuestLogEntry *qle = NULL; qle = static_cast<Player*>(mKiller)->GetQuestLogForEntry(10255); if(qle) { qle->SetMobCount(0,1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } }
void InnkeeperFlex(Player* pPlayer, Unit* pUnit) { if(pUnit->getEntry() == 6740) { QuestLogEntry* qle = pPlayer->GetQuestLogForEntry(8356); if(qle == NULL) return; qle->SetMobCount(0, qle->GetMobCount(0) + 1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } else if(pUnit->getEntry() == 6929) { QuestLogEntry* qle = pPlayer->GetQuestLogForEntry(8359); if(qle == NULL) return; qle->SetMobCount(0, qle->GetMobCount(0) + 1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } }
void Scratches(Player* pPlayer, uint32 AreaTrigger) { QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10556); if(qle == NULL) return; Creature* Kaliri = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 21468); if(Kaliri == NULL) return; Kaliri->Despawn(0, 0); qle->SetMobCount(0, qle->GetMobCount(0)+1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); }
void OnDied(Unit * mKiller) { if (mKiller->IsPlayer()) { QuestLogEntry *en = ((Player*)mKiller)->GetQuestLogForEntry(10836); if(en && en->GetMobCount(0) < en->GetQuest()->required_mobcount[0]) { uint32 newcount = en->GetMobCount(0) + 1; en->SetMobCount(0, newcount); en->SendUpdateAddKill(0); en->UpdatePlayerFields(); return; } } }
void OnDied(Unit * mKiller) { if(mKiller->GetTypeId() != TYPEID_PLAYER) return; QuestLogEntry *en = NULL; en = static_cast<Player*>(mKiller)->GetQuestLogForEntry(10864); if(en && en->GetMobCount(0) < en->GetQuest()->required_mobcount[0]) { uint32 newcount = en->GetMobCount(0) + 1; en->SetMobCount(0, newcount); en->SendUpdateAddKill(0); en->UpdatePlayerFields(); } }
void OnDied(Unit * mKiller) { if (mKiller->IsPlayer()) { QuestLogEntry *en = NULL; en = static_cast<Player*>(mKiller)->GetQuestLogForEntry(10482); if(en && en->GetMobCount(0) < en->GetQuest()->required_mobcount[0]) { uint32 newcount = en->GetMobCount(0) + 1; en->SetMobCount(0, newcount); en->SendUpdateAddKill(0); en->UpdatePlayerFields(); } } }
void GossipSelectOption(Object* pObject, Player* pPlayer, uint32 Id, uint32 IntId, const char* EnteredCode) { if(pPlayer == NULL) return; if(!pObject->IsCreature()) return; switch(IntId) { case 0: GossipHello(pObject, pPlayer); break; case 1: { int32 i = -1; Creature* pPrisoner = static_cast<Creature*>(pObject); switch(pPrisoner->GetEntry()) { case 20677: i = 0; break; case 20678: i = 1; break; case 20679: i = 2; break; } if(i == -1) return; QuestLogEntry* pQuest = pPlayer->GetQuestLogForEntry(10368); if(pQuest != NULL && pQuest->GetMobCount(i) < pQuest->GetQuest()->required_mobcount[i]) { pQuest->SetMobCount(i, pQuest->GetMobCount(i) + 1); pQuest->SendUpdateAddKill(i); pQuest->UpdatePlayerFields(); pPrisoner->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You've freed me! The winds speak to my people one again and grant us their strength. I thank you, stranger."); pPrisoner->Despawn(5000, 6 * 60 * 1000); pPrisoner->SetStandState(STANDSTATE_STAND); } } break; } }
bool FindingTheKeymaster(uint32 i, Spell * pSpell) { if(!pSpell->u_caster->IsPlayer()) return true; Player *plr = (Player*)pSpell->u_caster; QuestLogEntry *qle = plr->GetQuestLogForEntry(10256); if(!qle) return true; qle->SetMobCount(0, qle->GetMobCount(0)+1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); return true; }
void OnActivate(PlayerPointer pPlayer) { if(!pPlayer) return; QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10447); if(qle == NULL) return; if(qle->GetMobCount(1) < qle->GetQuest()->required_mobcount[1]) { qle->SetMobCount(1, qle->GetMobCount(1)+1); qle->SendUpdateAddKill(1); qle->UpdatePlayerFields(); } }
void OnActivate( Player *p ){ QuestLogEntry *qle = p->GetQuestLogForEntry(5097); if(qle == NULL){ qle = p->GetQuestLogForEntry(5098); if(qle == NULL) return; } if(qle->GetMobCount(2) < qle->GetQuest()->required_mobcount[2]){ qle->SetMobCount(2, qle->GetMobCount(2)+1); qle->SendUpdateAddKill(2); qle->UpdatePlayerFields(); } }
bool CrystalOfDeepShadows(uint32 i, Spell* pSpell) // Becoming a Shadoweave Tailor { if(!pSpell->u_caster->IsPlayer()) return true; Player *plr = (Player*)pSpell->u_caster; QuestLogEntry *qle = plr->GetQuestLogForEntry(10833); if(qle == NULL) return true; qle->SetMobCount(0, 1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); return true; }
void OnActivate(Player* pPlayer) { if(!pPlayer) return; QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(5581); if(qle == NULL) return; if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0]) { qle->SetMobCount(0, qle->GetMobCount(0)+1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } return; }
void GossipHello( ObjectPointer pObject, PlayerPointer pPlayer, bool AutoSend ) { if ( pObject == NULL || pObject->GetTypeId() != TYPEID_ITEM || pPlayer == NULL ) return; QuestLogEntry* QuestEntry = pPlayer->GetQuestLogForEntry( 9452 ); if ( QuestEntry == NULL ) return; #ifndef BLIZZLIKE //if ( QuestEntry->GetMobCount( 0 ) >= QuestEntry->GetQuest()->required_mobcount[ 0 ] ) // return; #endif if ( pPlayer->GetMapMgr() == NULLMAPMGR ) return; // Meh, double object looking - we should find a way to remove this GameObjectPointer School = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 181616 ); if ( School == NULLGOB || pPlayer->CalcDistance( School ) > 5.0f ) return; #ifdef BLIZZLIKE sEventMgr.AddEvent( School, &GameObject::Despawn, static_cast< uint32 >( 20000 ), EVENT_GAMEOBJECT_ITEM_SPAWN, 1000, 1, 0 ); #else School->Despawn( 20000 ); #endif pPlayer->CastSpell( pPlayer, dbcSpell.LookupEntry( TO_ITEM( pObject )->GetProto()->Spells[ 0 ].Id ), false ); uint32 Chance = RandomUInt( 10 ); if ( Chance <= 3 ) { CreaturePointer NewCreature = sEAS.SpawnCreature( pPlayer, 17102, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 180000 ); if ( NewCreature != NULLCREATURE ) { NewCreature->GetAIInterface()->StopMovement( 500 ); NewCreature->setAttackTimer( 1000, false ); NewCreature->m_noRespawn = true; }; return; }; sEAS.AddItem( 23614, pPlayer ); QuestEntry->SendUpdateAddKill( 1 ); QuestEntry->UpdatePlayerFields(); pPlayer->Gossip_Complete(); };
bool UnlockKarynakuChains(uint32 i, SpellPointer pSpell) // Becoming a Shadoweave Tailor { if(pSpell->u_caster->IsPlayer() == false) return true; PlayerPointer pPlayer= TO_PLAYER(pSpell->u_caster); QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry(10872); if(pQuest == NULL) return true; if ( pQuest && pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] ) { pQuest->SetMobCount(0, pQuest->GetMobCount(0)+1); pQuest->SendUpdateAddKill(0); pQuest->UpdatePlayerFields(); } return true; }
void OnDied(Unit * mKiller) { if (mKiller->IsPlayer()) { QuestLogEntry *qle = TO_PLAYER(mKiller)->GetQuestLogForEntry(11230); if( qle != NULL ) { if( qle->GetMobCount( 0 ) < qle->GetQuest()->required_mobcount[ 0 ] ) { uint32 newcount = qle->GetMobCount( 0 ) + 1; qle->SetMobCount( 0, newcount ); qle->SendUpdateAddKill( 0 ); qle->UpdatePlayerFields(); return; } } } }
void OnDied(Unit* pKiller) { Player* QuestHolder = NULL; if(pKiller->IsPlayer()) QuestHolder = TO_PLAYER(pKiller); else if(pKiller->IsPet() && TO_PET(pKiller)->GetPetOwner() != NULL) QuestHolder = TO_PET(pKiller)->GetPetOwner(); if(QuestHolder == NULL) return; // M4ksiu: I don't think the method is correct, but it can stay the way it was until someone gives proper infos QuestLogEntry* Quest = QuestHolder->GetQuestLogForEntry(9670); Creature* RandomCreature = NULL; if(Quest == NULL) { // Creatures from Bloodmyst Isle uint32 Id[ 51 ] = { 17681, 17887, 17550, 17323, 17338, 17341, 17333, 17340, 17353, 17320, 17339, 17337, 17715, 17322, 17494, 17654, 17342, 17328, 17331, 17325, 17321, 17330, 17522, 17329, 17524, 17327, 17661, 17352, 17334, 17326, 17324, 17673, 17336, 17346, 17589, 17609, 17608, 17345, 17527, 17344, 17347, 17525, 17713, 17523, 17348, 17606, 17604, 17607, 17610, 17358, 17588 }; RandomCreature = _unit->GetMapMgr()->GetInterface()->SpawnCreature(Id[ RandomUInt(50) ], _unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), _unit->GetOrientation(), true, false, 0, 0); if(RandomCreature != NULL) { RandomCreature->m_noRespawn = true; RandomCreature->Despawn(60000, 0); }; return; } else { uint32 Id[ 8 ] = { 17681, 17321, 17330, 17522, 17673, 17336, 17346, 17589 }; RandomCreature = _unit->GetMapMgr()->GetInterface()->SpawnCreature(Id[ RandomUInt(7) ], _unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), _unit->GetOrientation(), true, false, 0, 0); if(RandomCreature != NULL) { RandomCreature->m_noRespawn = true; RandomCreature->Despawn(60000, 0); if(RandomCreature->GetEntry() == 17681 && Quest->GetMobCount(0) < Quest->GetQuest()->required_mobcount[ 0 ]) { Quest->SetMobCount(0, Quest->GetMobCount(0) + 1); Quest->SendUpdateAddKill(0); Quest->UpdatePlayerFields(); }; }; }; };
void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char* Code) { if(!pObject->IsCreature()) return; switch(IntId) { case 1: { GossipMenu* Menu; objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 10614, plr); Menu->AddItem(0, "But you are dragons! How could orcs do this to you?", 2); Menu->SendTo(plr); } break; case 2: { GossipMenu* Menu; objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 10615, plr); Menu->AddItem(0, "Your mate?", 3); Menu->SendTo(plr); } break; case 3: { GossipMenu* Menu; objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 10616, plr); Menu->AddItem(0, "I have battled many beasts, dragon. I will help you.", 4); Menu->SendTo(plr); } break; case 4: { QuestLogEntry* pQuest = plr->GetQuestLogForEntry(10814); if(pQuest && pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0]) { pQuest->SetMobCount(0, 1); pQuest->SendUpdateAddKill(0); pQuest->UpdatePlayerFields(); } } break; } }
bool EyesAbove(uint32 i, Spell * pSpell) { if( !pSpell->p_caster ) return true; Unit * target = pSpell->GetUnitTarget(); if( !target || target->GetEntry() != 25432 || !target->isAlive()) return true; Player * pPlayer = pSpell->p_caster; QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 12453 ); if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] ) { en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 ); en->SendUpdateAddKill( 0 ); en->UpdatePlayerFields(); } return true; }
bool PrayerBeads(uint32 i, Spell * pSpell) { if( !pSpell->p_caster ) return true; Unit * target = pSpell->GetUnitTarget(); if( !target || target->GetEntry() != 22431 ) return true; Player * pPlayer = pSpell->p_caster; QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 10935 ); if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] ) { en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 ); en->SendUpdateAddKill( 0 ); en->UpdatePlayerFields(); } return true; }
bool PreparationForBattle(uint32 i, Spell* pSpell) { if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() ) return true; Player* pPlayer = TO_PLAYER( pSpell->u_caster ); QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 12842 ); if ( pQuest != NULL ) { if ( pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] ) { pQuest->SetMobCount( 0, pQuest->GetMobCount( 0 ) + 1 ); pQuest->SendUpdateAddKill( 0 ); pQuest->UpdatePlayerFields(); pQuest->SendQuestComplete(); } } return true; };
void OnActivate(Player* pPlayer) { if(pPlayer->HasFinishedQuest(4284)) { QuestLogEntry *en = pPlayer->GetQuestLogForEntry(4287); if(en && en->GetMobCount(0) < en->GetQuest()->required_mobcount[0]) { uint32 newcount = en->GetMobCount(0) + 1; en->SetMobCount(0, newcount); en->SendUpdateAddKill(0); en->UpdatePlayerFields(); return; } } else if(pPlayer->HasFinishedQuest(4284) == false) { pPlayer->BroadcastMessage("You need to have completed the quest : Crystals of Power"); } }
bool OrbOfMurlocControl(uint32 i, Spell* pSpell) { if(pSpell->m_caster->IsPlayer() == false) return true; Player* plr = TO_PLAYER(pSpell->u_caster); QuestLogEntry *pQuest = plr->GetQuestLogForEntry(11541); if(pQuest == NULL) return true; Unit* mTarget; Creature* cTarget; for(ObjectSet::iterator itr = pSpell->m_caster->GetInRangeSetBegin(); itr != pSpell->m_caster->GetInRangeSetEnd(); itr++) { if((*itr)->IsUnit()) mTarget = TO_UNIT(*itr); else continue; if(pSpell->m_caster->CalcDistance(mTarget) > 5 ) continue; cTarget = TO_CREATURE(mTarget); if(cTarget->GetEntry() == 25084) { if(pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0]) { pQuest->SetMobCount(0, pQuest->GetMobCount(0) + 1); pQuest->SendUpdateAddKill(0); Creature* FreedGreengill = sEAS.SpawnCreature(plr, 25085, cTarget->GetPositionX(), cTarget->GetPositionY(), cTarget->GetPositionZ(), cTarget->GetOrientation(), 0); FreedGreengill->Despawn(6*60*1000, 0); cTarget->Despawn(0, 6*60*1000); pQuest->UpdatePlayerFields(); return true; } } } return true; }
void OnActivate(Player* pPlayer) { QuestLogEntry* qle = pPlayer->GetQuestLogForEntry(9667); if(qle == NULL) return; if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0]) { qle->SetMobCount(0, qle->GetMobCount(0) + 1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } Creature* princess = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 17682); if(!princess) return; princess->Despawn(1000, 6 * 60 * 1000); return; }
void OnDied(Unit * mKiller) { if( !mKiller->IsPlayer() ) return; // don't credit if any other player kills my initiate if( mKiller->GetGUID() != _unit->GetSummonedByGUID() ) return; Player * plr = TO_PLAYER(mKiller); QuestLogEntry * qle = plr->GetQuestLogForEntry(12848); if( !qle ) return; qle->SetMobCount(0, 1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); qle->SendQuestComplete(); ParentClass::OnDied(mKiller); }
bool LayWreath(uint32 i, Spell* pSpell) //Peace at Last quest { if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() ) return true; Player *pPlayer = static_cast< Player* >( pSpell->u_caster ); QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 11152 ); if ( pQuest == NULL || pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] ) return true; GameObject *pWreath = sEAS.SpawnGameobject( pPlayer, 501541, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 1 ); if ( pWreath != NULL ) { sEAS.GameobjectDelete( pWreath, 2 * 60 * 1000 ); } pQuest->SetMobCount( 0, 1 ); pQuest->SendUpdateAddKill( 0 ); pQuest->UpdatePlayerFields(); return true; }
bool FindingTheSource(uint32 i, Spell * pSpell) { if(pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer()) return true; Player *plr = (Player*)pSpell->u_caster; QuestLogEntry *qle = plr->GetQuestLogForEntry(974); if( !qle ) return true; if ( qle->GetMobCount( 0 ) < qle->GetQuest()->required_mobcount[0] ) { uint32 NewCount = qle->GetMobCount( 0 ) + 1; qle->SetMobCount( 0, NewCount ); qle->SendUpdateAddKill( 0 ); qle->UpdatePlayerFields(); } return true; }
bool Screwdriver(uint32 i, Spell * pSpell) { if( !pSpell->p_caster ) return true; Unit * target = pSpell->GetUnitTarget(); if( !target || target->GetEntry() != 25753 || !target->IsDead()) return true; ((Creature*)target)->Despawn(500, 360000); Player * pPlayer = pSpell->p_caster; QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 11730 ); if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] ) { en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 ); en->SendUpdateAddKill( 0 ); en->UpdatePlayerFields(); } return true; }