aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/item/item_scripts.cpp25
-rw-r--r--src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp61
2 files changed, 84 insertions, 2 deletions
diff --git a/src/bindings/scripts/scripts/item/item_scripts.cpp b/src/bindings/scripts/scripts/item/item_scripts.cpp
index 889a4d900e8..22e437079f3 100644
--- a/src/bindings/scripts/scripts/item/item_scripts.cpp
+++ b/src/bindings/scripts/scripts/item/item_scripts.cpp
@@ -41,6 +41,7 @@ item_voodoo_charm Provide proper error message and target(q256
item_vorenthals_presence(i30259) Prevents abuse of this item
item_yehkinyas_bramble(i10699) Allow cast spell on vale screecher only and remove corpse if cast sucessful (q3520)
item_zezzak_shard(i31463) Quest The eyes of Grillok (q10813). Prevents abuse
+item_inoculating_crystal Quest Inoculating. Prevent abuse
EndContentData */
#include "precompiled.h"
@@ -286,6 +287,25 @@ bool ItemUse_item_muiseks_vessel(Player *player, Item* _Item, SpellCastTargets c
}
/*#####
+# item_inoculating_crystal
+#####*/
+
+bool ItemUse_item_inoculating_crystal(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 16518 )
+ return false;
+
+ WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
+ data << uint32(_Item->GetEntry()); // itemId
+ data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
+ player->GetSession()->SendPacket(&data); // send message: Invalid target
+
+ player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
+ return true;
+}
+
+/*#####
# item_razorthorn_flayer_gland
#####*/
@@ -520,6 +540,11 @@ void AddSC_item_scripts()
newscript->RegisterSelf();
newscript = new Script;
+ newscript->Name="item_inoculating_crystal";
+ newscript->pItemUse = &ItemUse_item_inoculating_crystal;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
newscript->Name="item_razorthorn_flayer_gland";
newscript->pItemUse = &ItemUse_item_razorthorn_flayer_gland;
newscript->RegisterSelf();
diff --git a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
index 92ce2caaa40..b4eefc43ce1 100644
--- a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
+++ b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Azuremyst_Isle
SD%Complete: 75
-SDComment: Quest support: 9283, 9537, 9582, 9554, 9531(special flight path, proper model for mount missing). Injured Draenei cosmetic only
+SDComment: Quest support: 9283, 9537, 9582, 9554, 9531, 9303(special flight path, proper model for mount missing). Injured Draenei cosmetic only
SDCategory: Azuremyst Isle
EndScriptData */
@@ -28,6 +28,7 @@ npc_injured_draenei
npc_magwin
npc_susurrus
npc_geezle
+mob_nestlewood_owlkin
EndContentData */
#include "precompiled.h"
@@ -608,9 +609,60 @@ CreatureAI* GetAI_npc_geezleAI(Creature *_Creature)
}
/*######
-##
+## mob_nestlewood_owlkin
######*/
+#define INOCULATION_CHANNEL 29528
+#define INOCULATED_OWLKIN 16534
+
+struct TRINITY_DLL_DECL mob_nestlewood_owlkinAI : public ScriptedAI
+{
+ mob_nestlewood_owlkinAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ChannelTimer;
+ bool Channeled;
+ bool Hitted;
+
+ void Reset()
+ {
+ ChannelTimer = 0;
+ Channeled = false;
+ Hitted = false;
+ }
+
+ void Aggro(Unit *who){}
+
+ void SpellHit(Unit* caster, const SpellEntry* spell)
+ {
+ if(!caster)
+ return;
+
+ if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == INOCULATION_CHANNEL)
+ {
+ ChannelTimer = 3000;
+ Hitted = true;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(ChannelTimer < diff && !Channeled && Hitted)
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveCorpse();
+ m_creature->SummonCreature(INOCULATED_OWLKIN, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000);
+ Channeled = true;
+ }else ChannelTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_nestlewood_owlkinAI(Creature *_Creature)
+{
+ return new mob_nestlewood_owlkinAI (_Creature);
+}
+
void AddSC_azuremyst_isle()
{
Script *newscript;
@@ -649,4 +701,9 @@ void AddSC_azuremyst_isle()
newscript->GetAI = &GetAI_npc_geezleAI;
newscript->RegisterSelf();
+ newscript = new Script;
+ newscript->Name="mob_nestlewood_owlkin";
+ newscript->GetAI = &GetAI_mob_nestlewood_owlkinAI;
+ newscript->RegisterSelf();
+
}