*Merged Scriptdev2 783

--HG--
branch : trunk
This commit is contained in:
Blaymoira
2008-12-13 19:56:53 +01:00
parent 8b4f5b6290
commit ed7a4d9831
131 changed files with 5742 additions and 4736 deletions
+3 -47
View File
@@ -491,58 +491,14 @@ CreatureAI* GetAI_guard_bluffwatcher(Creature *_Creature)
* guard_contested start
*******************************************************/
struct TRINITY_DLL_DECL guard_contested : public guardAI
CreatureAI* GetAI_guard_contested(Creature *_Creature)
{
guard_contested(Creature *c) : guardAI(c) {}
void MoveInLineOfSight(Unit *who)
{
if ( who->isAttackingPlayer() )
{
if(who->GetTypeId() == TYPEID_PLAYER || who->GetOwnerGUID() && GUID_HIPART(who->GetOwnerGUID())==HIGHGUID_PLAYER)
{
m_creature->AddThreat(who, 0.0f);
if(Unit* owner = who->GetOwner())
m_creature->AddThreat(owner, 0.0f);
if(!m_creature->isInCombat())
{
if (m_creature->GetEntry() == 15184) //Cenarion Hold Infantry
{
srand (time(NULL));
if (rand()%100 <= 30)
{
DoSay("Taste blade, mongrel!", LANG_UNIVERSAL,NULL);
}
else if (rand()%100 > 30 && rand()%100 < 50)
{
DoSay("Please tell me that you didn`t just do what I think you just did. Please tell me that I`m not going to have to hurt you...", LANG_UNIVERSAL,NULL);
}
else if (rand()%100 >= 50)
{
DoSay("As if we don`t have enough problems, you go and create more!", LANG_UNIVERSAL,NULL);
}
}
else
{
SpellEntry const *spell = m_creature->reachWithSpellAttack(who);
DoCastSpell(who, spell);
}
}
AttackStart(who);
}
}
}
};
return new guardAI (_Creature);
}
/*******************************************************
* guard_contested end
*******************************************************/
CreatureAI* GetAI_guard_contested(Creature *_Creature)
{
return new guard_contested (_Creature);
}
/*******************************************************
* guard_darnassus start
*******************************************************/