Example #1
0
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;
}
Example #2
0
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;
};
Example #3
0
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;
}
Example #4
0
	void OnActivate(Player* pPlayer)
	{
		if(pPlayer->HasFinishedQuest(4284))
		{
			QuestLogEntry *en = pPlayer->GetQuestLogForEntry(4285);
			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");
		}
	}
Example #5
0
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;
		}
// 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;
}
Example #8
0
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;
}
Example #9
0
	void OnActivate(Player * pPlayer)	
	{
	  QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10283);
  
	  if(qle == NULL)
		return;

	  if (++numBarrel == 5)
	  {
		qle->SetMobCount(0, qle->GetMobCount(0)+1);
		qle->SendUpdateAddKill(0);
		qle->UpdatePlayerFields();
		GameObject *obj = NULL;
		for(uint8 i = 0; i < 21; i++)
		{
			obj = sEAS.SpawnGameobject(pPlayer, GO_FIRE, Fires[i].x, Fires[i].y, Fires[i].z, Fires[i].o, 1);
			sEAS.GameobjectDelete(obj, 10*60*1000);
		}
		numBarrel = 0;
	  }
	}
Example #10
0
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;
}
Example #11
0
    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);
    }
Example #12
0
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;
}
Example #13
0
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;
}
Example #14
0
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;
}
Example #15
0
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;
}
Example #16
0
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;
}
Example #17
0
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;
 }
Example #18
0
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;
}
Example #19
0
	void OnActivate(Player* pPlayer)	
	{
	  QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10283);
  	  if (++numBarrel == 5)
	  {
	  	if(qle != NULL)
		{
			qle->SetMobCount(0, qle->GetMobCount(0)+1);
			qle->SendUpdateAddKill(0);
			qle->UpdatePlayerFields();
		}
		GameObject* obj = NULL;
		for(uint8 i = 0; i < 21; i++)
		{
			obj = sEAS.SpawnGameobject(pPlayer, GO_FIRE, Fires[i].x, Fires[i].y, Fires[i].z, Fires[i].o, 1, 0, 0, 0, 0);
			sEAS.GameobjectDelete(obj, 10*60*1000);
		}
		sEAS.SpawnCreature(pPlayer, 17848, 2138.8f, 45.4242f, 52.4437f, 0.0f, 0);
		numBarrel = 0;
	  }
	}
Example #20
0
    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;
}
Example #22
0
        void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char* Code)
        {
            Creature* pCreature = (pObject->IsCreature()) ? (static_cast<Creature*>(pObject)) : NULL;
            if(pCreature == NULL)
                return;

            GossipMenu* Menu;
            switch(IntId)
            {
                case 1:
                    {
                        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 13612, plr);
                        Menu->AddItem(ICON_CHAT, plr->GetSession()->LocalizedGossipOption(500), 2);     // I'm sorry that I didn't get here sooner. What happened?
                        Menu->SendTo(plr);
                    }
                    break;
                case 2:
                    {
                        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 13613, plr);
                        Menu->AddItem(ICON_CHAT, plr->GetSession()->LocalizedGossipOption(501), 3);     // I'll go get some help. Hang in there.
                        Menu->SendTo(plr);
                    }
                    break;
                case 3:
                    {
                        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 13614, plr);
                        Menu->SendTo(plr);

                        QuestLogEntry* qle = plr->GetQuestLogForEntry(12864);
                        if(qle == NULL || qle->GetMobCount(0) != 0)
                            return;

                        qle->SetMobCount(0, 1);
                        qle->SendUpdateAddKill(0);
                        qle->UpdatePlayerFields();
                    }
                    break;
            }
        }
Example #23
0
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;
}
Example #24
0
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;
}
Example #25
0
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 GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char* Code)
		{
			Creature* pCreature = (pObject->IsCreature()) ? (TO_CREATURE(pObject)) : NULL;
			if(pCreature == NULL)
				return;

			GossipMenu* Menu;
			switch(IntId)
			{
				case 1:
					{
						objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 13612, plr);
						Menu->AddItem(0, GOSSIP_SCOUTMENU2, 2);
						Menu->SendTo(plr);
					}
					break;
				case 2:
					{
						objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 13613, plr);
						Menu->AddItem(0, GOSSIP_SCOUTMENU3, 3);
						Menu->SendTo(plr);
					}
					break;
				case 3:
					{
						objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 13614, plr);
						Menu->SendTo(plr);

						QuestLogEntry* qle = plr->GetQuestLogForEntry(12864);
						if(qle == NULL || qle->GetMobCount(0) != 0)
							return;

						qle->SetMobCount(0, 1);
						qle->SendUpdateAddKill(0);
						qle->UpdatePlayerFields();
					}
					break;
			}
		}
Example #27
0
	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);
	}
Example #28
0
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;
}
Example #29
0
 void OnReachWP(uint32 iWaypointId, bool /*bForwards*/) override
 {
     switch (iWaypointId)
     {
         case 1:
         {
             SetWaypointMoveType(Movement::WP_MOVEMENT_SCRIPT_WANTEDWP);
             SetWaypointToMove(2);
             for (const auto& itr : getCreature()->getInRangeObjectsSet())
             {
                 if (itr && itr->isPlayer())
                 {
                     Player* pPlayer = static_cast<Player*>(itr);
                     if (pPlayer != nullptr)
                     {
                         QuestLogEntry* pQuest = pPlayer->GetQuestLogForEntry(10097);
                         if (pQuest != nullptr && pQuest->GetMobCount(1) < 1)
                         {
                             pQuest->SetMobCount(1, 1);
                             pQuest->SendUpdateAddKill(1);
                             pQuest->UpdatePlayerFields();
                         }
                     }
                 }
             }
         }
         break;
         case 3:
         {
             despawn(100, 0);
         }
         break;
         default:
         {
             SetWaypointMoveType(Movement::WP_MOVEMENT_SCRIPT_WANTEDWP);
             SetWaypointToMove(1);
         }
     }
 }
Example #30
0
//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;
}