*Support for creature 16518

*Support for item 22962

--HG--
branch : trunk
This commit is contained in:
Blaymoira
2009-01-15 16:45:24 +01:00
parent fcd3a31542
commit fb9a507643
3 changed files with 86 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
update creature_template set scriptname='mob_nestlewood_owlkin' where entry=16518;
update item_template set scriptname='item_inoculating_crystal' where entry=22962;

View File

@@ -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"
@@ -285,6 +286,25 @@ bool ItemUse_item_muiseks_vessel(Player *player, Item* _Item, SpellCastTargets c
return true;
}
/*#####
# 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
#####*/
@@ -519,6 +539,11 @@ void AddSC_item_scripts()
newscript->pItemUse = &ItemUse_item_muiseks_vessel;
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;

View File

@@ -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();
}