mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 07:38:36 +00:00
[Quest API] Add Client Spell Methods to Perl/Lua. (#2550)
* [Quest API] Add Client Spell Methods to Perl/Lua. # Perl - Add `$client->ApplySpell(spell_id)`. - Add `$client->ApplySpell(spell_id, duration)`. - Add `$client->ApplySpell(spell_id, duration, allow_pets)`. - Add `$client->ApplySpell(spell_id, duration, allow_pets, is_raid_group_only)`. - Add `$client->ApplySpell(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`. - Add `$client->ApplySpellGroup(spell_id)`. - Add `$client->ApplySpellGroup(spell_id, duration)`. - Add `$client->ApplySpellGroup(spell_id, duration, allow_pets)`. - Add `$client->ApplySpellGroup(spell_id, duration, allow_pets, is_raid_group_only)`. - Add `$client->ApplySpellGroup(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`. - Add `$client->ApplySpellRaid(spell_id)`. - Add `$client->ApplySpellRaid(spell_id, duration)`. - Add `$client->ApplySpellRaid(spell_id, duration, allow_pets)`. - Add `$client->ApplySpellRaid(spell_id, duration, allow_pets, is_raid_group_only)`. - Add `$client->ApplySpellRaid(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`. - Add `$client->SetSpellDuration(spell_id)`. - Add `$client->SetSpellDuration(spell_id, duration)`. - Add `$client->SetSpellDuration(spell_id, duration, allow_pets)`. - Add `$client->SetSpellDuration(spell_id, duration, allow_pets, is_raid_group_only)`. - Add `$client->SetSpellDuration(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`. - Add `$client->SetSpellDurationGroup(spell_id)`. - Add `$client->SetSpellDurationGroup(spell_id, duration)`. - Add `$client->SetSpellDurationGroup(spell_id, duration, allow_pets)`. - Add `$client->SetSpellDurationGroup(spell_id, duration, allow_pets, is_raid_group_only)`. - Add `$client->SetSpellDurationGroup(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`. - Add `$client->SetSpellDurationRaid(spell_id)`. - Add `$client->SetSpellDurationRaid(spell_id, duration)`. - Add `$client->SetSpellDurationRaid(spell_id, duration, allow_pets)`. - Add `$client->SetSpellDurationRaid(spell_id, duration, allow_pets, is_raid_group_only)`. - Add `$client->SetSpellDurationRaid(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`. # Lua - Add `client:ApplySpell(spell_id)`. - Add `client:ApplySpell(spell_id, duration)`. - Add `client:ApplySpell(spell_id, duration, allow_pets)`. - Add `client:ApplySpell(spell_id, duration, allow_pets, is_raid_group_only)`. - Add `client:ApplySpell(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`. - Add `client:ApplySpellGroup(spell_id)`. - Add `client:ApplySpellGroup(spell_id, duration)`. - Add `client:ApplySpellGroup(spell_id, duration, allow_pets)`. - Add `client:ApplySpellGroup(spell_id, duration, allow_pets, is_raid_group_only)`. - Add `client:ApplySpellGroup(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`. - Add `client:ApplySpellRaid(spell_id)`. - Add `client:ApplySpellRaid(spell_id, duration)`. - Add `client:ApplySpellRaid(spell_id, duration, allow_pets)`. - Add `client:ApplySpellRaid(spell_id, duration, allow_pets, is_raid_group_only)`. - Add `client:ApplySpellRaid(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`. - Add `client:SetSpellDuration(spell_id)`. - Add `client:SetSpellDuration(spell_id, duration)`. - Add `client:SetSpellDuration(spell_id, duration, allow_pets)`. - Add `client:SetSpellDuration(spell_id, duration, allow_pets, is_raid_group_only)`. - Add `client:SetSpellDuration(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`. - Add `client:SetSpellDurationGroup(spell_id)`. - Add `client:SetSpellDurationGroup(spell_id, duration)`. - Add `client:SetSpellDurationGroup(spell_id, duration, allow_pets)`. - Add `client:SetSpellDurationGroup(spell_id, duration, allow_pets, is_raid_group_only)`. - Add `client:SetSpellDurationGroup(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`. - Add `client:SetSpellDurationRaid(spell_id)`. - Add `client:SetSpellDurationRaid(spell_id, duration)`. - Add `client:SetSpellDurationRaid(spell_id, duration, allow_pets)`. - Add `client:SetSpellDurationRaid(spell_id, duration, allow_pets, is_raid_group_only)`. - Add `client:SetSpellDurationRaid(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`. # Notes - Allows operators extremely easy shorthands to cast on entire groups and raid groups and optionally include their bots and pets. - Default functionality for Raid is that it only casts on your group, set `is_raid_group_only` to `false` to cast on the entire Raid. * Cleanup. * Remove Raid parameter from Solo/Group methods.
This commit is contained in:
@@ -46,7 +46,7 @@ extern WorldServer worldserver;
|
||||
|
||||
// the spell can still fail here, if the buff can't stack
|
||||
// in this case false will be returned, true otherwise
|
||||
bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_override, int reflect_effectiveness, int32 duration_override, bool disable_buff_overrwrite)
|
||||
bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_override, int reflect_effectiveness, int32 duration_override, bool disable_buff_overwrite)
|
||||
{
|
||||
int caster_level, buffslot, effect, effect_value, i;
|
||||
EQ::ItemInstance *SummonedItem=nullptr;
|
||||
@@ -119,7 +119,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
}
|
||||
else
|
||||
{
|
||||
buffslot = AddBuff(caster, spell_id, duration_override, -1, disable_buff_overrwrite);
|
||||
buffslot = AddBuff(caster, spell_id, duration_override, -1, disable_buff_overwrite);
|
||||
}
|
||||
if(buffslot == -1) // stacking failure
|
||||
return false;
|
||||
@@ -186,7 +186,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if(IsVirusSpell(spell_id)) {
|
||||
|
||||
@@ -8091,7 +8091,7 @@ bool Mob::PassCastRestriction(int value)
|
||||
}
|
||||
else if (!IsNonSpellFighterClass(GetClass()) && GetManaRatio() <= 10) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (IsHybridClass(GetClass()) && CastToClient()->GetEndurancePercent() <= 10) {
|
||||
return true;
|
||||
}
|
||||
@@ -10292,7 +10292,7 @@ bool Mob::HasPersistDeathIllusion(int32 spell_id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Mob::SetBuffDuration(int32 spell_id, int32 duration) {
|
||||
void Mob::SetBuffDuration(int spell_id, int duration) {
|
||||
|
||||
/*
|
||||
Will refresh the buff with specified spell_id to the specified duration
|
||||
@@ -10331,7 +10331,7 @@ void Mob::SetBuffDuration(int32 spell_id, int32 duration) {
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::ApplySpellBuff(int32 spell_id, int32 duration)
|
||||
void Mob::ApplySpellBuff(int spell_id, int duration)
|
||||
{
|
||||
/*
|
||||
Used for quest command to apply a new buff with custom duration.
|
||||
@@ -10340,11 +10340,12 @@ void Mob::ApplySpellBuff(int32 spell_id, int32 duration)
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!spells[spell_id].buff_duration) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (duration < -1) {
|
||||
if (duration <= -1) {
|
||||
duration = PERMANENT_BUFF_DURATION;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user