(L, 3, true);
#ifndef TRINITY
unit->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, durLoss);
#else
unit->Kill(target, durLoss);
#endif
return 0;
}
/**
* Adds threat to the &Unit from the victim.
*
*
* enum SpellSchoolMask
* {
* SPELL_SCHOOL_MASK_NONE = 0,
* SPELL_SCHOOL_MASK_NORMAL = 1,
* SPELL_SCHOOL_MASK_HOLY = 2,
* SPELL_SCHOOL_MASK_FIRE = 4,
* SPELL_SCHOOL_MASK_NATURE = 8,
* SPELL_SCHOOL_MASK_FROST = 16,
* SPELL_SCHOOL_MASK_SHADOW = 32,
* SPELL_SCHOOL_MASK_ARCANE = 64,
* }
*
*
* @param &Unit victim : &Unit that caused the threat
* @param float threat : threat amount
* @param SpellSchoolMask schoolMask = 0 : spell school mask of the threat causer
* @param uint32 spell = 0 : spell entry used for threat
*/
int AddThreat(lua_State* L, Unit* unit)
{
Unit* victim = Eluna::CHECKOBJ(L, 2);
float threat = Eluna::CHECKVAL(L, 3, true);
uint32 schoolMask = Eluna::CHECKVAL(L, 3, 0);
uint32 spell = Eluna::CHECKVAL(L, 3, 0);
if (schoolMask > SPELL_SCHOOL_MASK_ALL)
{
return luaL_argerror(L, 3, "valid SpellSchoolMask expected");
}
#ifdef TRINITY
unit->AddThreat(victim, threat, (SpellSchoolMask)schoolMask, spell ? sSpellMgr->GetSpellInfo(spell) : NULL);
#else
unit->AddThreat(victim, threat, false, (SpellSchoolMask)schoolMask, spell ? sSpellStore.LookupEntry(spell) : NULL);
#endif
return 0;
}
/*int RestoreDisplayId(lua_State* L, Unit* unit)
{
unit->RestoreDisplayId();
return 0;
}*/
/*int RestoreFaction(lua_State* L, Unit* unit)
{
unit->RestoreFaction();
return 0;
}*/
/*int RemoveBindSightAuras(lua_State* L, Unit* unit)
{
unit->RemoveBindSightAuras();
return 0;
}*/
/*int RemoveCharmAuras(lua_State* L, Unit* unit)
{
unit->RemoveCharmAuras();
return 0;
}*/
/*int DisableMelee(lua_State* L, Unit* unit)
{
bool apply = Eluna::CHECKVAL(L, 2, true);
if (apply)
unit->AddUnitState(UNIT_STATE_CANNOT_AUTOATTACK);
else
unit->ClearUnitState(UNIT_STATE_CANNOT_AUTOATTACK);
return 0;
}*/
/*int SummonGuardian(lua_State* L, Unit* unit)
{
uint32 entry = Eluna::CHECKVAL(L, 2);
float x = Eluna::CHECKVAL(L, 3);
float y = Eluna::CHECKVAL(L, 4);
float z = Eluna::CHECKVAL(L, 5);
float o = Eluna::CHECKVAL(L, 6);
uint32 desp = Eluna::CHECKVAL(L, 7, 0);
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(61);
if (!properties)
return 1;
Position pos;
pos.Relocate(x,y,z,o);
TempSummon* summon = unit->GetMap()->SummonCreature(entry, pos, properties, desp, unit);
if (!summon)
return 1;
if (summon->HasUnitTypeMask(UNIT_MASK_GUARDIAN))
((Guardian*)summon)->InitStatsForLevel(unit->getLevel());
if (properties && properties->Category == SUMMON_CATEGORY_ALLY)
summon->setFaction(unit->getFaction());
if (summon->GetEntry() == 27893)
{
if (uint32 weapon = unit->GetUInt32Value(PLAYER_VISIBLE_ITEM_16_ENTRYID))
{
summon->SetDisplayId(11686);
summon->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, weapon);
}
else
summon->SetDisplayId(1126);
}
summon->AI()->EnterEvadeMode();
Eluna::Push(L, summon);
return 1;
}*/
};
#endif