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 PreparationForBattle(uint32 i, Spell* pSpell) { if(pSpell->p_caster == NULL) return true; Player* pPlayer = pSpell->p_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; };
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; }
void OnActivate(Player * pPlayer) { if(pPlayer->HasFinishedQuest(4284)) { QuestLogEntry *en = pPlayer->GetQuestLogForEntry(4288); 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; }
bool PoweringOurDefenses(uint32 i, Spell* pSpell) { if(pSpell->u_caster->IsPlayer() == false) return true; Player * plr = TO_PLAYER(pSpell->u_caster); QuestLogEntry *qle = plr->GetQuestLogForEntry( 8490 ); if( qle == NULL ) return true; // Angelis : Need to script the scourge attack if( qle && qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0] ) { qle->SetMobCount(0, qle->GetMobCount(0)+1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } return true; }
// Protecting Our Own bool ProtectingOurOwn(uint32 i, Spell* pSpell) { if(pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer()) return true; Player* plr = TO_PLAYER(pSpell->u_caster); QuestLogEntry *qle = plr->GetQuestLogForEntry(10488); if(qle == NULL) 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 HodirsHorn(uint32 i, Spell * pSpell) { if( !pSpell->p_caster ) return true; Unit * target = pSpell->GetUnitTarget(); if( !target || ( target->GetEntry() != 29974 && target->GetEntry() != 30144 && target->GetEntry() != 30135) || !target->IsDead()) return true; TO_CREATURE(target)->Despawn(500, 360000); Player * pPlayer = pSpell->p_caster; QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 12977 ); 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 PlagueSpray(uint32 i, Spell * pSpell) { if( !pSpell->p_caster ) return true; Unit * target = pSpell->GetUnitTarget(); if( !target || target->GetEntry() != 23652 || !target->isAlive()) return true; else if(!target || target->GetEntry() != 23652 || !target->HasAura(40467)) return false; Player * pPlayer = pSpell->p_caster; QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 11307 ); 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 StoppingtheSpread(uint32 i, Spell* pSpell) { Player *pPlayer = (Player*)pSpell->u_caster; if(!pPlayer) return true; if(!pSpell->u_caster->IsPlayer()) return true; QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(9874); if(qle == NULL) return true; if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0]) { qle->SetMobCount(0, qle->GetMobCount(0)+1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } return true; }
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 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; }
bool RagefistTorch(uint32 i, Spell * pSpell) { if( !pSpell->p_caster ) return true; Unit * target = pSpell->GetUnitTarget(); if( !target || ( target->GetEntry() != 25342 && target->GetEntry() != 25343)) return true; ((Creature*)target)->Despawn(500, 360000); Player * pPlayer = pSpell->p_caster; QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 11593 ); 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 TelluricPoultice(uint32 i, Spell * pSpell) { if( !pSpell->p_caster ) return true; Unit * target = pSpell->GetUnitTarget(); if( !target || target->GetEntry() != 30035) return true; ((Creature*)target)->Despawn(500, 360000); Player * pPlayer = pSpell->p_caster; QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 12937 ); 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 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; }
void GossipSelectOption(ObjectPointer pObject, PlayerPointer plr, uint32 Id, uint32 IntId, const char * Code) { if(pObject->GetTypeId()!=TYPEID_UNIT) 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 HealingTheLake(uint32 i, SpellPointer pSpell) { if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() ) return true; PlayerPointer pPlayer = TO_PLAYER( pSpell->u_caster ); QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 9294 ); if ( pQuest == NULL ) return true; if ( pQuest->GetMobCount( 0 ) < pQuest->GetQuest()->required_mobcount[0] ) { pQuest->SetMobCount( 0, pQuest->GetMobCount( 0 ) + 1 ); pQuest->SendUpdateAddKill( 0 ); pQuest->UpdatePlayerFields(); return true; } return true; }
void GossipHello(Object* pObject, Player* pPlayer, bool AutoSend) { if ( pPlayer == NULL ) // useless, but who knows return; if ( !pObject->IsCreature() ) // can't imagine to get this null lol return; 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] ) { if ( pPlayer->GetItemInterface()->GetItemCount( 29501 ) > 0 ) { GossipMenu *Menu; objmgr.CreateGossipMenuForPlayer( &Menu, pObject->GetGUID(), 10104, pPlayer ); Menu->AddItem( 0, "Walk free, Elder. Bring the spirits back to your tribe.", 1 ); if ( AutoSend ) Menu->SendTo( pPlayer ); } } }
bool ConvertingSentry(uint32 i, Spell* pSpell) { Player *caster = pSpell->p_caster; if(caster == NULL) return true; Creature *target = static_cast<Creature*>(pSpell->GetUnitTarget()); if(target == NULL) return true; // Erratic Sentry: 24972 if(target->GetEntry() != 24972) return true; if(!target->isAlive()) return true; QuestLogEntry *qle = NULL; qle = caster->GetQuestLogForEntry(11525); if(qle == NULL) { qle = caster->GetQuestLogForEntry(11524); if(qle == NULL) { return true; } } if(qle->GetMobCount(0) == qle->GetQuest()->required_mobcount[0]) return true; qle->SetMobCount(0, qle->GetMobCount(0)+1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); target->Despawn(500, 2*60*1000); return true; }
bool ADireSituation(uint32 i, Spell * pSpell) { Player * pPlayer = TO_PLAYER(pSpell->u_caster); if(!pPlayer) return true; if(!pSpell->u_caster->IsPlayer()) return true; QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10506); if(qle == NULL) return true; if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0]) { qle->SetMobCount(0, qle->GetMobCount(0)+1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } return true; }
bool IncendiaPowder(uint32 i, Spell * pSpell) { if(!pSpell->p_caster) return true; QuestLogEntry *en = pSpell->p_caster->GetQuestLogForEntry(5088); if(pSpell->p_caster->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(pSpell->p_caster->GetPositionX(), pSpell->p_caster->GetPositionY(), pSpell->p_caster->GetPositionZ(), 175944) && en) { if(en->GetMobCount(0) < en->GetQuest()->required_mobcount[0]) { en->SetMobCount(0, 1); en->SendUpdateAddKill(0); en->UpdatePlayerFields(); return false; } } pSpell->p_caster->GetMapMgr()->GetInterface()->SpawnCreature(10882, -5005.387695f, -2103.348145f, 83.862106f, 6.265121f, true, false, 0, 0); return true; }
void OnActivate(PlayerPointer pPlayer) { if(!pPlayer) return; QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(9544); 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(); } CreaturePointer prisoner = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 17375); if(!prisoner) return; prisoner->Despawn(1, 6*60*1000); }
//Ruthless Cunning bool RuthlessCunning(uint32 i, Spell * pSpell) { if(!pSpell->u_caster->IsPlayer()) return true; Player *plr = (Player*)pSpell->u_caster; Creature * kilsorrow = plr->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(plr->GetPositionX(), plr->GetPositionY() , plr->GetPositionZ()); if(!kilsorrow || kilsorrow->isAlive()) return true; QuestLogEntry *qle = plr->GetQuestLogForEntry(9927); if(qle && qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0]) { kilsorrow->Despawn(0, 60000); qle->SetMobCount(0, qle->GetMobCount(0)+1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } return true; }
bool IncineratingOil(uint32 i, Spell * pSpell) { if( !pSpell->p_caster ) return true; Unit * target = pSpell->GetUnitTarget(); if( !target || target->GetEntry() != 28156 ) return true; TO_CREATURE(target)->Despawn(500, 360000); Player * pPlayer = pSpell->p_caster; QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 12568 ); 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 AwakenPeon(uint32 i, Spell * pSpell) { if ( pSpell == NULL || pSpell->p_caster == NULL ) return true; Player * pPlayer = pSpell->p_caster; Unit * pUnit = pSpell->GetUnitTarget(); if ( pUnit == NULL || !pUnit->IsCreature() ) return true; Creature * pTarget = TO_CREATURE( pUnit ); if ( !pTarget->HasAura( 17743 ) ) return true; if ( pTarget->GetEntry() == 10556 ) { QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 5441 ); if ( pQuest == NULL || pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] ) return true; WorldPacket data(SMSG_PLAY_OBJECT_SOUND, 12); data << uint32( 6197 ) << pTarget->GetGUID(); pPlayer->SendMessageToSet(&data, true); pTarget->RemoveAllAuras(); string Text; Text = "Ow! Ok, I'll get back to work, "; Text += pPlayer->GetName(); Text += "!"; pTarget->SendChatMessage( CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, Text.c_str() ); pTarget->Emote( EMOTE_STATE_WORK_CHOPWOOD ); pQuest->SetMobCount( 0, pQuest->GetMobCount(0)+1 ); pQuest->SendUpdateAddKill( 0 ); pQuest->UpdatePlayerFields(); } return true; }
bool DouseEternalFlame(uint32 i, Spell* pSpell) { if (pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer()) return true; Player* plr = TO_PLAYER(pSpell->u_caster); QuestLogEntry *qle = plr->GetQuestLogForEntry(9737); if(qle == NULL) return true; GameObject* Flame = plr->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(3678, -3640, 139, 182068); if(Flame != NULL) { if(plr->CalcDistance(plr, Flame) < 30) if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0]) { qle->SetMobCount(0, qle->GetMobCount(0)+1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } } return true; }
void GossipHello(Object* pObject, Player* pPlayer, bool AutoSend) { if(!pPlayer) return; GossipMenu *Menu; Creature *Prisoner1 = (Creature*)(pObject); if (Prisoner1 == NULL) return; objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 10104, pPlayer); QuestLogEntry *en = pPlayer->GetQuestLogForEntry(10368); if(en && en->GetMobCount(0) == en->GetQuest()->required_mobcount[0]) return; if(pPlayer->GetQuestLogForEntry(10368) && pPlayer->GetItemInterface()->GetItemCount(29501) > 0) Menu->AddItem( 0, "Walk free, Elder. Bring the spirits back to your tribe.", 1); if(AutoSend) Menu->SendTo(pPlayer); }
bool ForceofNeltharakuSpell(uint32 i, SpellPointer pSpell) // Becoming a Shadoweave Tailor { if(pSpell->u_caster->IsPlayer() == false) return true; PlayerPointer pPlayer= TO_PLAYER(pSpell->u_caster); UnitPointer pUnit = TO_UNIT(pPlayer->GetMapMgr()->GetCreature(GET_LOWGUID_PART(pPlayer->GetSelection()))); if(pUnit == NULLUNIT) return true; if(!pUnit->IsCreature()) return true; CreaturePointer pTarget = TO_CREATURE(pUnit); QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry(10854); if(pQuest == NULL) return true; if(pTarget->GetEntry() == 21722 && pPlayer->CalcDistance(pUnit)<30) { if ( pQuest && pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] ) { pTarget->CastSpell(pPlayer, dbcSpell.LookupEntry(38775), true); pQuest->SetMobCount(0, pQuest->GetMobCount(0)+1); pQuest->SendUpdateAddKill(0); pQuest->UpdatePlayerFields(); if ( pTarget->GetScript() != NULL ) { MoonScriptCreatureAI *pDrakeAI = static_cast<MoonScriptCreatureAI*>(pTarget->GetScript()); pDrakeAI->SetCanMove(true); pDrakeAI->SetWaypointToMove(0); } } } return true; }
bool WelcomingtheWolfSpirit(uint32 i, Spell* pSpell) { Player *pPlayer = (Player*)pSpell->u_caster; if(!pPlayer) return true; if(!pSpell->u_caster->IsPlayer()) return true; QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10791); if(qle == NULL) return true; Creature *spiritwolf = sEAS.SpawnCreature(pPlayer, 19616, pPlayer->GetPositionX()+2, pPlayer->GetPositionY()+3, pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 0); spiritwolf->Despawn(5*60*1000, 0); if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0]) { qle->SetMobCount(0, qle->GetMobCount(0)+1); qle->SendUpdateAddKill(0); qle->UpdatePlayerFields(); } return true; }