mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Quest API] Add Buff Support to Perl/Lua (#4182)
* [Quest API] Add Buff Support to Perl/Lua - Add `$mob->GetCasterID()`. - Add `$mob->GetCasterLevel()`. - Add `$mob->GetCasterName()`. - Add `$mob->GetCastOnX()`. - Add `$mob->GetCastOnY()`. - Add `$mob->GetCastOnZ()`. - Add `$mob->GetCounters()`. - Add `$mob->GetDOTRune()`. - Add `$mob->GetExtraDIChance()`. - Add `$mob->GetInstrumentModi()`. - Add `$mob->GetMagicRune()`. - Add `$mob->GetMeleeRune()`. - Add `$mob->GetNumberOfHits()`. - Add `$mob->GetRootBreakChanc()`. - Add `$mob->GetSpellID()`. - Add `$mob->GetTicsRemaining()`. - Add `$mob->GetVirusSpreadTim()`. - Add `$mob->IsCasterClient()`. - Add `$mob->IsPersistentBuff()`. - Add `$mob->SendsClientUpdate()`. - Add `mob:GetCasterID()`. - Add `mob:GetCasterLevel()`. - Add `mob:GetCasterName()`. - Add `mob:GetCastOnX()`. - Add `mob:GetCastOnY()`. - Add `mob:GetCastOnZ()`. - Add `mob:GetCounters()`. - Add `mob:GetDOTRune()`. - Add `mob:GetExtraDIChance()`. - Add `mob:GetInstrumentModi()`. - Add `mob:GetMagicRune()`. - Add `mob:GetMeleeRune()`. - Add `mob:GetNumberOfHits()`. - Add `mob:GetRootBreakChanc()`. - Add `mob:GetSpellID()`. - Add `mob:GetTicsRemaining()`. - Add `mob:GetVirusSpreadTim()`. - Add `mob:IsCasterClient()`. - Add `mob:IsPersistentBuff()`. - Add `mob:SendsClientUpdate()`. - Adds support for `Buffs_Struct` to Perl/Lua. - Allows operators to read a mob's buff data directly to determine caster, melee rune, etc. * Fix GetCasterID() to proper data type. * Remove Lua_Buffs, return table instead. * Cleanup
This commit is contained in:
@@ -3425,6 +3425,19 @@ std::string Perl_Mob_GetDeityName(Mob* self)
|
||||
return EQ::deity::GetDeityName(static_cast<EQ::deity::DeityType>(self->GetDeity()));
|
||||
}
|
||||
|
||||
perl::array Perl_Mob_GetBuffs(Mob* self)
|
||||
{
|
||||
perl::array result;
|
||||
|
||||
const auto& buffs = self->GetBuffs();
|
||||
|
||||
for (int slot_id = 0; slot_id < self->GetMaxBuffSlots(); slot_id++) {
|
||||
result.push_back(&buffs[slot_id]);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void perl_register_mob()
|
||||
{
|
||||
perl::interpreter perl(PERL_GET_THX);
|
||||
@@ -3610,6 +3623,7 @@ void perl_register_mob()
|
||||
package.add("GetBucketExpires", &Perl_Mob_GetBucketExpires);
|
||||
package.add("GetBucketKey", &Perl_Mob_GetBucketKey);
|
||||
package.add("GetBucketRemaining", &Perl_Mob_GetBucketRemaining);
|
||||
package.add("GetBuffs", &Perl_Mob_GetBuffs);
|
||||
package.add("GetBuffSlotFromType", &Perl_Mob_GetBuffSlotFromType);
|
||||
package.add("GetBuffSpellIDs", &Perl_Mob_GetBuffSpellIDs);
|
||||
package.add("GetBuffStatValueBySpell", &Perl_Mob_GetBuffStatValueBySpell);
|
||||
|
||||
Reference in New Issue
Block a user