mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Scripts/Icecrown: Move Squire David to SmartAI
(cherry picked from commit 64bed16a57)
Conflicts:
src/server/game/Spells/SpellMgr.cpp
This commit is contained in:
22
sql/updates/world/2015_05_20_00_world_2015_05_19_01.sql
Normal file
22
sql/updates/world/2015_05_20_00_world_2015_05_19_01.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
-- Gossip Menu Option for Squire David (33447)
|
||||
SET @SourceGroup = 10340;
|
||||
SET @SourceEntry = 0;
|
||||
SET @ConditionTypeOrReference = 9;
|
||||
|
||||
DELETE FROM conditions where SourceGroup=@SourceGroup and SourceEntry=@SourceEntry;
|
||||
INSERT INTO conditions(SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionTarget, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorType, ErrorTextId, ScriptName, Comment) VALUES
|
||||
(15, @SourceGroup, @SourceEntry, 0, 0, @ConditionTypeOrReference, 0, 13679, 0, 0, 0, 0, 0, '', 'Show gossip option if player has quest 13679'),
|
||||
(15, @SourceGroup, @SourceEntry, 0, 1, @ConditionTypeOrReference, 0, 13680, 0, 0, 0, 0, 0, '', 'Show gossip option if player has quest 13680');
|
||||
|
||||
-- Squire David SAI
|
||||
SET @ENTRY := 33447;
|
||||
UPDATE creature_template SET ScriptName="" WHERE entry=33447;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
|
||||
(@ENTRY,0,0,1,62,0,100,0,10340,0,0,0,11,63028,0,0,0,0,0,7,0,0,0,0,0,0,0,"Squire David - On Gossip Option 0 Selected - Cast 'Force Cast'"),
|
||||
(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Squire David - On Gossip Option 0 Selected - Close Gossip");
|
||||
|
||||
DELETE FROM `spell_target_position` WHERE `id`=63026;
|
||||
INSERT INTO `spell_target_position` (`id`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`) VALUES
|
||||
(63026, 0, 571, 8575.38, 921.85, 547.554);
|
||||
@@ -3030,6 +3030,9 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
|
||||
switch (spellInfo->Id)
|
||||
{
|
||||
case 63026: // Force Cast (HACK: Target shouldn't be changed)
|
||||
const_cast<SpellEffectInfo*>(spellInfo->GetEffect(EFFECT_0))->TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB);
|
||||
break;
|
||||
case 42436: // Drink! (Brewfest)
|
||||
const_cast<SpellEffectInfo*>(spellInfo->GetEffect(EFFECT_0))->TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
|
||||
break;
|
||||
|
||||
@@ -24,53 +24,6 @@
|
||||
#include "TemporarySummon.h"
|
||||
#include "CombatAI.h"
|
||||
|
||||
/*######
|
||||
## npc_squire_david
|
||||
######*/
|
||||
|
||||
enum SquireDavid
|
||||
{
|
||||
QUEST_THE_ASPIRANT_S_CHALLENGE_H = 13680,
|
||||
QUEST_THE_ASPIRANT_S_CHALLENGE_A = 13679,
|
||||
|
||||
NPC_ARGENT_VALIANT = 33448,
|
||||
|
||||
GOSSIP_TEXTID_SQUIRE = 14407
|
||||
};
|
||||
|
||||
#define GOSSIP_SQUIRE_ITEM_1 "I am ready to fight!"
|
||||
#define GOSSIP_SQUIRE_ITEM_2 "How do the Argent Crusader raiders fight?"
|
||||
|
||||
class npc_squire_david : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_squire_david() : CreatureScript("npc_squire_david") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_THE_ASPIRANT_S_CHALLENGE_H) == QUEST_STATUS_INCOMPLETE ||
|
||||
player->GetQuestStatus(QUEST_THE_ASPIRANT_S_CHALLENGE_A) == QUEST_STATUS_INCOMPLETE)//We need more info about it.
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SQUIRE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SQUIRE_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
}
|
||||
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_SQUIRE, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
creature->SummonCreature(NPC_ARGENT_VALIANT, 8575.451f, 952.472f, 547.554f, 0.38f);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_argent_valiant
|
||||
######*/
|
||||
@@ -837,7 +790,6 @@ class npc_frostbrood_skytalon : public CreatureScript
|
||||
|
||||
void AddSC_icecrown()
|
||||
{
|
||||
new npc_squire_david;
|
||||
new npc_argent_valiant;
|
||||
new npc_guardian_pavilion;
|
||||
new npc_tournament_training_dummy;
|
||||
|
||||
Reference in New Issue
Block a user