void OnTriggerEnter(Collider other)
{
//Get the NPC that hit the ward
NPC npc = other.gameObject.GetComponent <NPC>();
if (npc != null) //Has the collision hit an npc
{
spellprop.init(SpellEffect.UW1_Spell_Effect_RuneofWarding, UWCharacter.Instance.gameObject);
if (spellprop.BaseDamage != 0)
{
npc.ApplyAttack(spellprop.BaseDamage);
}
spellprop.onImpact(npc.transform);
spellprop.onHit(npc.gameObject.GetComponent <ObjectInteraction>());
this.GetComponent <ObjectInteraction>().objectloaderinfo.InUseFlag = 0;
Destroy(this.gameObject);
}
else
{
if (other.gameObject.GetComponent <UWCharacter>())
{
spellprop.onImpactPlayer();
}
}
}