Hello i repairing quest on one server... but i have problem with this ..
I have Script
//Burn in Effigy//
//SQL - UPDATE 'creature_template' SET 'ScriptName'=borean_charge_holes where entry=25510;//
//SQL - UPDATE 'creature_template' SET 'ScriptName'=borean_charge_holes where entry=25511;//
//SQL - UPDATE 'creature_template' SET 'ScriptName'=borean_charge_holes where entry=25512;//
//SQL - UPDATE 'creature_template' SET 'ScriptName'=borean_charge_holes where entry=25513;//
#include "precompiled.h"
struct MANGOS_DLL_DECL borean_burn_in_effigyAI : public Scripted_NoMovementAI
{
borean_burn_in_effigyAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature)
{
Reset();
};
Player* summoner;
Creature* hole;
uint32 hole_id;
uint32 blow_timer;
uint32 disap_timer;
void Reset()
{
summoner = GetPlayerAtMinimumRange(50.0f);
hole_id = 0;
hole = NULL;
blow_timer = 1000;
disap_timer = 1500;
if(hole = GetClosestCreatureWithEntry(m_creature,25510,50.0f)) hole_id = hole->GetEntry();
if(hole = GetClosestCreatureWithEntry(m_creature,25511,50.0f)) hole_id = hole->GetEntry();
if(hole = GetClosestCreatureWithEntry(m_creature,25512,50.0f)) hole_id = hole->GetEntry();
if(hole = GetClosestCreatureWithEntry(m_creature,25513,50.0f)) hole_id = hole->GetEntry();
}
void MoveInLineOfSight(Unit *pWho)
{
if(!summoner && pWho->GetTypeId() == TYPEID_PLAYER)
summoner = (Player*)pWho;
}
void UpdateAI(const uint32 diff)
{
if(blow_timer < diff)
{
if(hole_id && (hole = GetClosestCreatureWithEntry(m_creature,hole_id,50.0f)))
{
if(summoner)
{
summoner->DealDamage(hole,hole->GetHealth(),0,DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NORMAL,0,false);
hole->Respawn();
}
m_creature->setFaction(16);
m_creature->CastSpell(m_creature,49210,false);
}
blow_timer = 10000;
} else blow_timer -= diff;
if(disap_timer < diff)
{
m_creature->DealDamage(m_creature,m_creature->GetHealth(),0,DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NORMAL,0,false);
m_creature->SetVisibility(VISIBILITY_OFF);
} else disap_timer -= diff;
}
};
CreatureAI* GetAI_borean_burn_in_effigy(Creature* pCreature)
{
return new borean_burn_in_effigyAI(pCreature);
}
void AddSC_borean_burn_in_effigy()
{
Script* newscript;
newscript = new Script;
newscript->Name = "borean_burn_in_effigy";
newscript->GetAI = &GetAI_borean_burn_in_effigy;
newscript->RegisterSelf();
}
But when i give Script to NPC and Objects of this i spawn NPC (Infernos)
and i use item and always red text .... where i have problem?Inferno has got 0/1 but when i kill him dont add in quest to complete