DragonFire/Dragon — Issue #768: [Quest/FIX] The Valiant`s Challenge
Author: Maserati
Created: 2011-11-23 21:39:48+00:00
State: open

diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp
index 27054b5..77641fe 100644
--- a/src/server/scripts/Northrend/icecrown.cpp
+++ b/src/server/scripts/Northrend/icecrown.cpp
@@ -276,6 +276,149 @@ public:
};

/*######
+## npc_squire_danny
+######*/
+
+enum eSquireDanny
+{
+	QUEST_THE_VALIANT_S_CHALLENGE_TH = 13727,
+	QUEST_THE_VALIANT_S_CHALLENGE_OH = 13726,
+	QUEST_THE_VALIANT_S_CHALLENGE_CH = 13728,
+	QUEST_THE_VALIANT_S_CHALLENGE_UH = 13729,
+	QUEST_THE_VALIANT_S_CHALLENGE_BH = 13731,
+	QUEST_THE_VALIANT_S_CHALLENGE_GA = 13723,
+	QUEST_THE_VALIANT_S_CHALLENGE_KA = 13724,
+	QUEST_THE_VALIANT_S_CHALLENGE_NA = 13725,
+	QUEST_THE_VALIANT_S_CHALLENGE_HA = 13699,
+	QUEST_THE_VALIANT_S_CHALLENGE_DA = 33312,
+
+ NPC_ARGENT_CHAMPION = 33707,
+
+ GOSSIP_TEXTID_DANNY = 14407
+};
+
+#define GOSSIP_DANNY_ITEM "I am ready to fight!"
+
+class npc_squire_danny : public CreatureScript
+{
+public:
+ npc_squire_danny() : CreatureScript("npc_squire_danny") { }
+
+ bool OnGossipHello(Player* player, Creature* creature)
+ {
+ if (player->GetQuestStatus(QUEST_THE_VALIANT_S_CHALLENGE_TH) == QUEST_STATUS_INCOMPLETE ||
+	player->GetQuestStatus(QUEST_THE_VALIANT_S_CHALLENGE_OH) == QUEST_STATUS_INCOMPLETE ||
+	player->GetQuestStatus(QUEST_THE_VALIANT_S_CHALLENGE_CH) == QUEST_STATUS_INCOMPLETE ||
+	player->GetQuestStatus(QUEST_THE_VALIANT_S_CHALLENGE_UH) == QUEST_STATUS_INCOMPLETE ||
+	player->GetQuestStatus(QUEST_THE_VALIANT_S_CHALLENGE_BH) == QUEST_STATUS_INCOMPLETE ||
+	player->GetQuestStatus(QUEST_THE_VALIANT_S_CHALLENGE_GA) == QUEST_STATUS_INCOMPLETE ||
+	player->GetQuestStatus(QUEST_THE_VALIANT_S_CHALLENGE_KA) == QUEST_STATUS_INCOMPLETE ||
+	player->GetQuestStatus(QUEST_THE_VALIANT_S_CHALLENGE_NA) == QUEST_STATUS_INCOMPLETE ||
+	player->GetQuestStatus(QUEST_THE_VALIANT_S_CHALLENGE_HA) == QUEST_STATUS_INCOMPLETE ||
+	player->GetQuestStatus(QUEST_THE_VALIANT_S_CHALLENGE_DA) == QUEST_STATUS_INCOMPLETE)//We need more info about it.
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DANNY_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ }
+
+ player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DANNY, creature->GetGUID());
+ return true;
+ }
+
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ player->PlayerTalkClass->ClearMenus();
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ creature->SummonCreature(NPC_ARGENT_CHAMPION, 8528.780f, 1057.373f, 548.805f, 1.12f);
+ }
+ return true;
+ }
+};
+
+/*######
+## npc_argent_champion
+######*/
+
+enum eArgentChampion
+{
+ SPELL_CHARGE1 = 63010,
+ SPELL_SHIELD_BREAKER1 = 65147,
+
+ NPC_ARGENT_CHAMPION_CREDIT = 33708
+};
+
+class npc_argent_champion : public CreatureScript
+{
+public:
+ npc_argent_champion() : CreatureScript("npc_argent_champion") { }
+
+ struct npc_argent_championAI : public ScriptedAI
+ {
+ npc_argent_championAI(Creature* creature) : ScriptedAI(creature)
+ {
+ creature->GetMotionMaster()->MovePoint(0, 8551.926f, 1101.852f, 556.787f);
+ creature->setFaction(35); //wrong faction in db?
+ }
+
+ uint32 uiChargeTimer;
+ uint32 uiShieldBreakerTimer;
+
+ void Reset()
+ {
+ uiChargeTimer = 7000;
+ uiShieldBreakerTimer = 10000;
+ }
+
+ void MovementInform(uint32 uiType, uint32 /*uiId*/)
+ {
+ if (uiType != POINT_MOTION_TYPE)
+ return;
+
+ me->setFaction(14);
+ }
+
+ void DamageTaken(Unit* pDoneBy, uint32& uiDamage)
+ {
+ if (uiDamage > me->GetHealth() && pDoneBy->GetTypeId() == TYPEID_PLAYER)
+ {
+ uiDamage = 0;
+ CAST_PLR(pDoneBy)->KilledMonsterCredit(NPC_ARGENT_CHAMPION_CREDIT, 0);
+ me->setFaction(35);
+ me->DespawnOrUnsummon(5000);
+ me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
+ EnterEvadeMode();
+ }
+ }
+
+ void UpdateAI(const uint32 uiDiff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (uiChargeTimer <= uiDiff)
+ {
+ DoCastVictim(SPELL_CHARGE);
+ uiChargeTimer = 7000;
+ } else uiChargeTimer -= uiDiff;
+
+ if (uiShieldBreakerTimer <= uiDiff)
+ {
+ DoCastVictim(SPELL_SHIELD_BREAKER);
+ uiShieldBreakerTimer = 10000;
+ } else uiShieldBreakerTimer -= uiDiff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_argent_championAI(creature);
+ }
+};
+
+/*######
## npc_alorah_and_grimmin
######*/

@@ -432,6 +575,8 @@ void AddSC_icecrown()
new npc_dame_evniki_kapsalis;
new npc_squire_david;
new npc_argent_valiant;
+	new npc_squire_danny;
+	new npc_argent_champion;
new npc_alorah_and_grimmin;
new npc_guardian_pavilion;
new npc_vereth_the_cunning;