diff options
-rw-r--r-- | sql/FULL/world_script_waypoints.sql | 37 | ||||
-rw-r--r-- | sql/FULL/world_scripts_full.sql | 2 | ||||
-rw-r--r-- | sql/updates/5009_world.sql | 1 | ||||
-rw-r--r-- | sql/updates/5009_world_TDB.sql | 1 | ||||
-rw-r--r-- | sql/updates/5009_world_scripts.sql | 16 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/npc/npcs_special.cpp | 98 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp | 88 | ||||
-rw-r--r-- | src/game/Pet.cpp | 10 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 5 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 10 |
10 files changed, 245 insertions, 23 deletions
diff --git a/sql/FULL/world_script_waypoints.sql b/sql/FULL/world_script_waypoints.sql index 91b416b5e3f..5aae839f3ec 100644 --- a/sql/FULL/world_script_waypoints.sql +++ b/sql/FULL/world_script_waypoints.sql @@ -1031,14 +1031,31 @@ INSERT INTO `script_waypoint` VALUES (3678, 23, 114.619, 235.908, -96.0495, 0, ''), (3678, 24, 114.777, 237.155, -96.0304, 2500, 'NARALEX_EVENT_FINISHED'); -/* EOF */ +DELETE FROM `script_waypoint` WHERE `entry` = 22424; +INSERT INTO `script_waypoint` VALUES +('22424','0','-3605.719971','4175.580078','-0.031817','0','START_SKYWING'), +('22424','1','-3602.311279','4253.213867','0.562436','0',''), +('22424','2','-3529.151367','4263.524414','-7.871151','0',''), +('22424','3','-3448.130371','4257.990723','-11.626289','0',''), +('22424','4','-3377.783936','4209.064941','-9.476727','0',''), +('22424','5','-3378.211426','4154.628418','0.366330','0',''), +('22424','6','-3376.920166','4085.501709','14.178538','0',''), +('22424','7','-3399.274658','4055.948975','18.603474','0',''), +('22424','8','-3432.678223','4054.069824','29.588032','10000',''); + +DELETE FROM `script_waypoint` WHERE `entry` = 22377; +INSERT INTO `script_waypoint` VALUES +(22377, 0, -2766.31, 5429.65, -34.53, 0, ''), +(22377, 1, -2769.35, 5416.25, -34.53, 0, ''), +(22377, 2, -2780.07, 5416.06, -34.53, 1000, ''), +(22377, 3, -2812.56, 5415.20, -34.53, 1000, ''), +(22377, 4, -2816.95, 5415.02, -34.52, 0, ''), +(22377, 5, -2827.86, 5414.56, -28.29, 0, ''), +(22377, 6, -2878.32, 5414.11, -28.26, 0, ''), +(22377, 7, -2893.17, 5413.15, -18.59, 0, ''), +(22377, 8, -2896.36, 5409.65, -18.59, 0, ''), +(22377, 9, -2896.50, 5396.76, -8.77, 0, ''), +(22377, 10, -2896.67, 5366.20, -9.59, 0, ''), +(22377, 11, -2888.23, 5330.39, -11.19, 2000, ''); -insert into `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) values('22424','0','-3605.719971','4175.580078','-0.031817','0','START_SKYWING'); -insert into `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) values('22424','1','-3602.311279','4253.213867','0.562436','0',''); -insert into `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) values('22424','2','-3529.151367','4263.524414','-7.871151','0',''); -insert into `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) values('22424','3','-3448.130371','4257.990723','-11.626289','0',''); -insert into `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) values('22424','4','-3377.783936','4209.064941','-9.476727','0',''); -insert into `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) values('22424','5','-3378.211426','4154.628418','0.366330','0',''); -insert into `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) values('22424','6','-3376.920166','4085.501709','14.178538','0',''); -insert into `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) values('22424','7','-3399.274658','4055.948975','18.603474','0',''); -insert into `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) values('22424','8','-3432.678223','4054.069824','29.588032','10000','');
\ No newline at end of file +/* EOF */
\ No newline at end of file diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 4bd45feb993..fa83cee479a 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -109,6 +109,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_valkyr_battle_maiden' WHERE `en UPDATE `creature_template` SET `ScriptName`='npc_mirror_image' WHERE `entry`=31216; UPDATE `creature_template` SET `ScriptName`='npc_training_dummy' WHERE `entry` IN (17578,24792,32543,32546,32542,32545,30527,31143,31144,31146,32541,32666,32667); UPDATE `creature_template` SET `ScriptName`='npc_lightwell' WHERE `entry` IN (31883,31893,31894,31895,31896,31897); +UPDATE `creature_template` SET `ScriptName`='npc_ebon_gargoyle' WHERE `entry`=27829; /* */ /* ZONE */ @@ -997,6 +998,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_floon' WHERE `entry`=18588; UPDATE `creature_template` SET `ScriptName`='npc_isla_starmane' WHERE `entry`=18760; UPDATE `creature_template` SET `ScriptName`='mob_unkor_the_ruthless' WHERE `entry`=18262; UPDATE `creature_template` SET `ScriptName`='npc_slim' WHERE `entry`=19679; +UPDATE `creature_template` SET `ScriptName`='npc_akuno' WHERE `entry`=22377; /* THOUSAND NEEDLES */ UPDATE `creature_template` SET `ScriptName`='npc_paoka_swiftmountain' WHERE `entry`=10427; diff --git a/sql/updates/5009_world.sql b/sql/updates/5009_world.sql new file mode 100644 index 00000000000..0a50905614a --- /dev/null +++ b/sql/updates/5009_world.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_ebon_gargoyle' WHERE `entry`=27829;
\ No newline at end of file diff --git a/sql/updates/5009_world_TDB.sql b/sql/updates/5009_world_TDB.sql new file mode 100644 index 00000000000..574546fb60b --- /dev/null +++ b/sql/updates/5009_world_TDB.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `spell1`=51963 WHERE `entry`=27829;
\ No newline at end of file diff --git a/sql/updates/5009_world_scripts.sql b/sql/updates/5009_world_scripts.sql new file mode 100644 index 00000000000..732614d4ad9 --- /dev/null +++ b/sql/updates/5009_world_scripts.sql @@ -0,0 +1,16 @@ +UPDATE `creature_template` SET `ScriptName`='npc_akuno' WHERE `entry`=22377; + +DELETE FROM `script_waypoint` WHERE `entry`=22377; +INSERT INTO `script_waypoint` VALUES +(22377, 0, -2766.31, 5429.65, -34.53, 0, ''), +(22377, 1, -2769.35, 5416.25, -34.53, 0, ''), +(22377, 2, -2780.07, 5416.06, -34.53, 1000, ''), +(22377, 3, -2812.56, 5415.20, -34.53, 1000, ''), +(22377, 4, -2816.95, 5415.02, -34.52, 0, ''), +(22377, 5, -2827.86, 5414.56, -28.29, 0, ''), +(22377, 6, -2878.32, 5414.11, -28.26, 0, ''), +(22377, 7, -2893.17, 5413.15, -18.59, 0, ''), +(22377, 8, -2896.36, 5409.65, -18.59, 0, ''), +(22377, 9, -2896.50, 5396.76, -8.77, 0, ''), +(22377, 10, -2896.67, 5366.20, -9.59, 0, ''), +(22377, 11, -2888.23, 5330.39, -11.19, 2000, ''); diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index 1764708d0e3..68c3e0e2559 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -1685,6 +1685,91 @@ CreatureAI* GetAI_npc_mirror_image(Creature* pCreature) return new npc_mirror_image (pCreature); } +struct TRINITY_DLL_DECL npc_ebon_gargoyleAI : SpellCasterAI +{ + npc_ebon_gargoyleAI(Creature *c) : SpellCasterAI(c) {} + + int despawnTimer; + + void InitializeAI() + { + SpellCasterAI::InitializeAI(); + Unit * owner = me->GetOwner(); + if (!owner) + return; + // Not needed to be despawned now + despawnTimer = 0; + // Find victim of Summon Gargoyle spell + std::list<Unit*> targets; + Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_creature, m_creature, 30); + Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(m_creature, targets, u_check); + m_creature->VisitNearbyObject(30, searcher); + for(std::list<Unit*>::iterator iter = targets.begin(); iter != targets.end(); ++iter) + if((*iter)->GetAura(49206,owner->GetGUID())) + { + me->Attack((*iter),false); + break; + } + } + + void JustDied(Unit *killer) + { + // Stop Feeding Gargoyle when it dies + if (Unit *owner = me->GetOwner()) + owner->RemoveAurasDueToSpell(50514); + } + + // Fly away when dismissed + void SpellHit(Unit *source, const SpellEntry *spell) + { + if(spell->Id != 50515 || !me->isAlive() ) + return; + + Unit *owner = me->GetOwner(); + + if (!owner || owner != source) + return; + + // Stop Fighting + me->ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE, true); + // Sanctuary + me->CastSpell(m_creature, 54661, true); + me->SetReactState(REACT_PASSIVE); + + // Fly Away + me->AddUnitMovementFlag(MOVEMENTFLAG_FLY_MODE); + me->SetSpeed(MOVE_FLIGHT, 0.25f, true); + me->SetSpeed(MOVE_RUN, 0.25f, true); + float x = me->GetPositionX() + 10 * cos(me->GetOrientation()); + float y = me->GetPositionY() + 10 * sin(me->GetOrientation()); + float z = me->GetPositionZ() + 25; + me->GetMotionMaster()->MovePoint(0, x, y, z); + + // Despawn as soon as possible + despawnTimer = 4 * IN_MILISECONDS; + } + + void UpdateAI(const uint32 diff) + { + if (despawnTimer > 0) + { + if (despawnTimer > diff) + despawnTimer -= diff; + else + { + me->ForcedDespawn(); + } + return; + } + SpellCasterAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_ebon_gargoyle(Creature* pCreature) +{ + return new npc_ebon_gargoyleAI (pCreature); +} + //TODO: 30% Attackdamage check for Lightwell struct TRINITY_DLL_DECL npc_lightwellAI : public PassiveAI { @@ -1853,13 +1938,18 @@ void AddSC_npcs_special() newscript->RegisterSelf(); newscript = new Script; - newscript->Name="npc_lightwell"; - newscript->GetAI = &GetAI_npc_lightwellAI; + newscript->Name="npc_mirror_image"; + newscript->GetAI = &GetAI_npc_mirror_image; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="npc_mirror_image"; - newscript->GetAI = &GetAI_npc_mirror_image; + newscript->Name="npc_ebon_gargoyle"; + newscript->GetAI = &GetAI_npc_ebon_gargoyle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_lightwell"; + newscript->GetAI = &GetAI_npc_lightwellAI; newscript->RegisterSelf(); newscript = new Script; diff --git a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp index 5616ecfcd88..d875a721b7e 100644 --- a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp +++ b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp @@ -613,6 +613,88 @@ bool GossipSelect_npc_slim(Player* pPlayer, Creature* pCreature, uint32 uiSender return true; } +/*######## +####npc_Akuno +#####*/ + +#define QUEST_NPC_AKUNO 10887 +#define Summon 21661 + +struct TRINITY_DLL_DECL npc_akunoAI : public npc_escortAI +{ + npc_akunoAI(Creature *c) : npc_escortAI(c) {} + + bool IsWalking; + + + void WaypointReached(uint32 i) + { + Player* player = Unit::GetPlayer(PlayerGUID); + + if(!player) + return; + + if(IsWalking && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + + switch(i) + { + case 0 : m_creature->setFaction(5);break; + case 3 : m_creature->SummonCreature(Summon,-2795.99,5420.33,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(Summon,-2793.55,5412.79,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 11 : { + if(player && player->GetTypeId() == TYPEID_PLAYER) + ((Player*)player)->GroupEventHappens(QUEST_NPC_AKUNO,m_creature); + m_creature->setFaction(18);break; + } + } + } + void Aggro(Unit* who) + {} + + void Reset() + { + if (IsWalking && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + return; + } + IsWalking=false; + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + if (Player* player = Unit::GetPlayer(PlayerGUID)) + player->FailQuest(QUEST_NPC_AKUNO); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + + bool QuestAccept_npc_akuno(Player* player, Creature* creature, Quest const* quest) + { + if(quest->GetQuestId() == QUEST_NPC_AKUNO) + { + ((npc_escortAI*)creature->AI())->Start(false,true,player->GetGUID()); + } + return true; + } + +CreatureAI* GetAI_npc_akuno(Creature *_Creature) +{ + npc_akunoAI* thisAI = new npc_akunoAI(_Creature); + thisAI->FillPointMovementListForCreature(); + return(CreatureAI*)thisAI; +} + void AddSC_terokkar_forest() { Script *newscript; @@ -666,5 +748,11 @@ void AddSC_terokkar_forest() newscript->pGossipHello = &GossipHello_npc_slim; newscript->pGossipSelect = &GossipSelect_npc_slim; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_akuno"; + newscript->GetAI = &GetAI_npc_akuno; + newscript->pQuestAccept = &QuestAccept_npc_akuno; + newscript->RegisterSelf(); } diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 894a3b37f32..3bce66a631a 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -940,6 +940,16 @@ bool Guardian::InitStatsForLevel(uint32 petlevel) } break; } + case 27829: // Ebon Gargoyle + { + SetBonusDamage( int32(m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.4f)); + if(!pInfo) + { + SetCreateMana(28 + 10*petlevel); + SetCreateHealth(28 + 30*petlevel); + } + break; + } default: { if(!pInfo) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 23357171352..b682bab6254 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1233,6 +1233,11 @@ void Aura::HandleAuraSpecificMods(bool apply) return; m_target->CastSpell(m_target, 32612, true, NULL, GetPartAura(1)); } + // Summon Gargoyle + else if (m_spellProto->Id == 50514) + { + m_target->CastSpell(m_target, GetPartAura(0)->GetAmount(), true, NULL, GetPartAura(0)); + } // Curse of Doom else if(m_spellProto->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellProto->SpellFamilyFlags[1] & 0x02) { diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index c826c70900a..154357c76f8 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1909,20 +1909,12 @@ void Spell::EffectDummy(uint32 i) { // No power, dismiss Gargoyle if (m_caster->GetPower(POWER_RUNIC_POWER)<30) - m_caster->CastSpell((Unit*)NULL,50515,true); + m_caster->RemoveAurasDueToSpell(50514, m_caster->GetGUID()); else m_caster->ModifyPower(POWER_RUNIC_POWER,-30); return; } - // Dismiss Gargoyle - else if (m_spellInfo->Id == 50515) - { - // FIXME: gargoyle should fly away - unitTarget->setDeathState(JUST_DIED); - m_caster->RemoveAurasDueToSpell(50514); - return; - } break; } |