예제 #1
0
bool TheSeersRelic(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(9545);
  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;
}
예제 #2
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);
	}
예제 #3
0
		void GossipHello(Object* pObject, Player * Plr, bool AutoSend)
		{
			GossipMenu * Menu;
			QuestLogEntry * en = Plr->GetQuestLogForEntry( 8304 );

			objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 7736, Plr);

			if ( en && en->GetMobCount(1) < en->GetQuest()->required_mobcount[1] )
				Menu->AddItem(0, "Hello, Rutgar. The Commander has sent me here to gather some information about his missing wife.", 3);

			if(AutoSend)
				Menu->SendTo(Plr);
		}
예제 #4
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;
}
예제 #5
0
bool ConvertingSentry(uint32 i, Spell* pSpell)
{
  Player* caster = pSpell->p_caster;
  if(caster == NULL)
    return true;

  Creature* target = TO_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;
}
예제 #6
0
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;
}
예제 #7
0
파일: QuestHooks.cpp 프로젝트: vata/wowice
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();
    }
}
예제 #8
0
파일: Paladin.cpp 프로젝트: Bootz/arcticdev
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;
}
예제 #9
0
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();
    }
}
예제 #10
0
파일: QuestHooks.cpp 프로젝트: vata/wowice
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();
    }
}
예제 #11
0
bool PoweringOurDefenses(uint32 i, Spell* pSpell)
{
	if(pSpell->u_caster->IsPlayer() == false)
    return true;

	Player * plr = (Player*)pSpell->u_caster;
	if( plr == NULL )
		return true;

	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;
}
예제 #12
0
파일: QuestHooks.cpp 프로젝트: vata/wowice
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();
    }
}
예제 #13
0
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;
}
예제 #14
0
    void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char * EnteredCode)
    {
        if(!plr)
            return;

        Creature* Prisoner22 = TO_CREATURE(pObject);
        if (Prisoner22 == NULL)
            return;

        switch (IntId)
        {
        case 0:
            GossipHello(pObject, plr, true);
            break;

        case 1:
        {
            QuestLogEntry *en = plr->GetQuestLogForEntry(9164);
            if(en && en->GetMobCount(1) < en->GetQuest()->required_mobcount[1])
            {
                en->SetMobCount(1, en->GetMobCount(1) + 1);
                en->SendUpdateAddKill(1);
                en->UpdatePlayerFields();

                if(!Prisoner22)
                    return;

                Prisoner22->Despawn(5000, 6*60*1000);
                Prisoner22->SetStandState(STANDSTATE_STAND);
                Prisoner22->SetUInt32Value(UNIT_NPC_EMOTESTATE, 7);
                return;
            }
            break;
        }
        }
    }
예제 #15
0
	void OnActivate(PlayerPointer pPlayer)
	{
		if(!pPlayer)
			return;

		QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10111);
		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 bird = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 19055);
		if(bird)
			return;

		bird = sEAS.SpawnCreature(pPlayer, 19055, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 0);
		if ( bird != NULL )
			bird->Despawn(5*60*1000, 0);
	}
예제 #16
0
bool OrbOfMurlocControl(uint32 i, Spell* pSpell)
{
  if(pSpell->u_caster->IsPlayer() == false)
    return true;

  Player *plr = (Player*)pSpell->u_caster;
  Unit *unit_target = (Unit*)plr->GetMapMgr()->GetCreature(GET_LOWGUID_PART(plr->GetSelection()));
  
  if(unit_target == NULL)
    return true;

  if(!unit_target->IsCreature())
    return true;

  Creature *target = (Creature*)unit_target;

  QuestLogEntry *qle = plr->GetQuestLogForEntry(11541);
  if(qle == NULL)
    return true;
  
  if(target->GetEntry() == 25084)
  {
      if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
      {
		uint32 newcount = qle->GetMobCount(0) + 1;
		qle->SetMobCount(0, newcount);
		qle->SendUpdateAddKill(0);		
		Creature *FreedGreengill = sEAS.SpawnCreature(plr, 25085, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0);
		FreedGreengill->Despawn(6*60*1000, 0);
		target->Despawn(0, 6*60*1000);
		qle->UpdatePlayerFields();
        return true;
      }  
  }
  return true;
}
	void OnDied(Unit * mKiller)
	{
		if ( mKiller == NULL || !mKiller->IsPlayer() )
			return;

		Player *pPlayer = static_cast< Player* >( mKiller );
		QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 10502 );
		if ( pQuest == NULL )
		{
			pQuest = pPlayer->GetQuestLogForEntry( 10505 );
			if ( pQuest == NULL )
			{
				return;
			}
		}

		if ( pQuest->GetMobCount( 0 ) < pQuest->GetQuest()->required_mobcount[0] )
		{
			uint32 NewCount = pQuest->GetMobCount( 0 ) + 1;
			pQuest->SetMobCount( 0, NewCount );
			pQuest->SendUpdateAddKill( 0 );
			pQuest->UpdatePlayerFields();
		}
	}
예제 #18
0
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;
}
예제 #19
0
파일: QuestHooks.cpp 프로젝트: vata/wowice
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();
}
예제 #20
0
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 OnHello(Object* pObject, Player* plr)
		{
			int32 i = -1;
			Creature* pPrisoner = TO_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 = plr->GetQuestLogForEntry(10368);
			if(pQuest != NULL && pQuest->GetMobCount(i) < pQuest->GetQuest()->required_mobcount[i] && plr->GetItemInterface()->GetItemCount(29501) > 0)
				Arcemu::Gossip::Menu::SendQuickMenu(pObject->GetGUID(), 10104, plr, 1, Arcemu::Gossip::ICON_CHAT, "Walk free, Elder. Bring the spirits back to your tribe.");
		}
예제 #22
0
        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;
            }
        }
예제 #23
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;
}
예제 #24
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;
	  }
	}
예제 #25
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;
	  }
	}
예제 #26
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;
}
예제 #27
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;
            }
        }
예제 #28
0
	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 );
			}
		}
   	}
예제 #29
0
		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;
			}
		}
예제 #30
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);
         }
     }
 }