diff --git a/zone/bot.cpp b/zone/bot.cpp index a8fe627e3..5541ede4d 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -8568,6 +8568,7 @@ std::vector Bot::GetApplySpellList( void Bot::ApplySpell( int spell_id, int duration, + int level, ApplySpellType apply_type, bool allow_pets, bool is_raid_group_only @@ -8575,13 +8576,14 @@ void Bot::ApplySpell( const auto& l = GetApplySpellList(apply_type, allow_pets, is_raid_group_only); for (const auto& m : l) { - m->ApplySpellBuff(spell_id, duration); + m->ApplySpellBuff(spell_id, duration, level); } } void Bot::SetSpellDuration( int spell_id, int duration, + int level, ApplySpellType apply_type, bool allow_pets, bool is_raid_group_only @@ -8589,7 +8591,7 @@ void Bot::SetSpellDuration( const auto& l = GetApplySpellList(apply_type, allow_pets, is_raid_group_only); for (const auto& m : l) { - m->SetBuffDuration(spell_id, duration); + m->SetBuffDuration(spell_id, duration, level); } } diff --git a/zone/bot.h b/zone/bot.h index 55f3fa3e5..69e2a634c 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -584,7 +584,7 @@ public: // "Quest API" Methods bool HasBotSpellEntry(uint16 spellid); - void ApplySpell(int spell_id, int duration = 0, ApplySpellType apply_type = ApplySpellType::Solo, bool allow_pets = false, bool is_raid_group_only = true); + void ApplySpell(int spell_id, int duration = 0, int level = -1, ApplySpellType apply_type = ApplySpellType::Solo, bool allow_pets = false, bool is_raid_group_only = true); void BreakInvis(); void Escape(); void Fling(float value, float target_x, float target_y, float target_z, bool ignore_los = false, bool clip_through_walls = false, bool calculate_speed = false); @@ -593,7 +593,7 @@ public: int32 GetAugmentIDAt(int16 slot_id, uint8 augslot); int32 GetRawItemAC(); void SendSpellAnim(uint16 targetid, uint16 spell_id); - void SetSpellDuration(int spell_id, int duration = 0, ApplySpellType apply_type = ApplySpellType::Solo, bool allow_pets = false, bool is_raid_group_only = true); + void SetSpellDuration(int spell_id, int duration = 0, int level = -1, ApplySpellType apply_type = ApplySpellType::Solo, bool allow_pets = false, bool is_raid_group_only = true); // "SET" Class Methods void SetBotSpellID(uint32 newSpellID); diff --git a/zone/client.cpp b/zone/client.cpp index f9a633cfa..c3e6a4840 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -11288,6 +11288,7 @@ std::vector Client::GetApplySpellList( void Client::ApplySpell( int spell_id, int duration, + int level, ApplySpellType apply_type, bool allow_pets, bool is_raid_group_only, @@ -11296,13 +11297,14 @@ void Client::ApplySpell( const auto& l = GetApplySpellList(apply_type, allow_pets, is_raid_group_only, allow_bots); for (const auto& m : l) { - m->ApplySpellBuff(spell_id, duration); + m->ApplySpellBuff(spell_id, duration, level); } } void Client::SetSpellDuration( int spell_id, int duration, + int level, ApplySpellType apply_type, bool allow_pets, bool is_raid_group_only, @@ -11311,7 +11313,7 @@ void Client::SetSpellDuration( const auto& l = GetApplySpellList(apply_type, allow_pets, is_raid_group_only, allow_bots); for (const auto& m : l) { - m->SetBuffDuration(spell_id, duration); + m->SetBuffDuration(spell_id, duration, level); } } diff --git a/zone/client.h b/zone/client.h index 212e8bbc1..3cd8f1629 100644 --- a/zone/client.h +++ b/zone/client.h @@ -923,6 +923,7 @@ public: void ApplySpell( int spell_id, int duration = 0, + int level = -1, ApplySpellType apply_type = ApplySpellType::Solo, bool allow_pets = false, bool is_raid_group_only = true, @@ -932,6 +933,7 @@ public: void SetSpellDuration( int spell_id, int duration = 0, + int level = -1, ApplySpellType apply_type = ApplySpellType::Solo, bool allow_pets = false, bool is_raid_group_only = true, diff --git a/zone/lua_bot.cpp b/zone/lua_bot.cpp index cea430b6a..843b631e5 100644 --- a/zone/lua_bot.cpp +++ b/zone/lua_bot.cpp @@ -155,44 +155,58 @@ void Lua_Bot::ApplySpell(int spell_id, int duration) { self->ApplySpell(spell_id, duration); } -void Lua_Bot::ApplySpell(int spell_id, int duration, bool allow_pets) { +void Lua_Bot::ApplySpell(int spell_id, int duration, int level) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Solo, allow_pets); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Solo); +} + +void Lua_Bot::ApplySpell(int spell_id, int duration, int level, bool allow_pets) { + Lua_Safe_Call_Void(); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Solo, allow_pets); } void Lua_Bot::ApplySpellGroup(int spell_id) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, 0, ApplySpellType::Group); + self->ApplySpell(spell_id, 0, -1, ApplySpellType::Group); } void Lua_Bot::ApplySpellGroup(int spell_id, int duration) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Group); + self->ApplySpell(spell_id, duration, -1, ApplySpellType::Group); +} +void Lua_Bot::ApplySpellGroup(int spell_id, int duration, int level) { + Lua_Safe_Call_Void(); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Group); } -void Lua_Bot::ApplySpellGroup(int spell_id, int duration, bool allow_pets) { +void Lua_Bot::ApplySpellGroup(int spell_id, int duration, int level, bool allow_pets) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Group, allow_pets); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Group, allow_pets); } void Lua_Bot::ApplySpellRaid(int spell_id) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, 0, ApplySpellType::Raid); + self->ApplySpell(spell_id, 0, -1, ApplySpellType::Raid); } void Lua_Bot::ApplySpellRaid(int spell_id, int duration) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Raid, true, true); + self->ApplySpell(spell_id, duration, -1, ApplySpellType::Raid, true, true); } -void Lua_Bot::ApplySpellRaid(int spell_id, int duration, bool allow_pets) { +void Lua_Bot::ApplySpellRaid(int spell_id, int duration, int level) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Raid, allow_pets, true); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid, true, true); } -void Lua_Bot::ApplySpellRaid(int spell_id, int duration, bool allow_pets, bool is_raid_group_only) { +void Lua_Bot::ApplySpellRaid(int spell_id, int duration, int level, bool allow_pets) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Raid, allow_pets, is_raid_group_only); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid, allow_pets, true); +} + +void Lua_Bot::ApplySpellRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only) { + Lua_Safe_Call_Void(); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid, allow_pets, is_raid_group_only); } void Lua_Bot::SetSpellDuration(int spell_id) { @@ -205,44 +219,59 @@ void Lua_Bot::SetSpellDuration(int spell_id, int duration) { self->SetSpellDuration(spell_id, duration); } -void Lua_Bot::SetSpellDuration(int spell_id, int duration, bool allow_pets) { +void Lua_Bot::SetSpellDuration(int spell_id, int duration, int level) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Solo, allow_pets); + self->SetSpellDuration(spell_id, duration, level); +} + +void Lua_Bot::SetSpellDuration(int spell_id, int duration, int level, bool allow_pets) { + Lua_Safe_Call_Void(); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Solo, allow_pets); } void Lua_Bot::SetSpellDurationGroup(int spell_id) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, 0, ApplySpellType::Group); + self->SetSpellDuration(spell_id, 0, -1, ApplySpellType::Group); } void Lua_Bot::SetSpellDurationGroup(int spell_id, int duration) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Group); + self->SetSpellDuration(spell_id, duration, -1, ApplySpellType::Group); } -void Lua_Bot::SetSpellDurationGroup(int spell_id, int duration, bool allow_pets) { +void Lua_Bot::SetSpellDurationGroup(int spell_id, int duration, int level) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Group, allow_pets); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Group); +} + +void Lua_Bot::SetSpellDurationGroup(int spell_id, int duration, int level, bool allow_pets) { + Lua_Safe_Call_Void(); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Group, allow_pets); } void Lua_Bot::SetSpellDurationRaid(int spell_id) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, 0, ApplySpellType::Raid); + self->SetSpellDuration(spell_id, 0, -1, ApplySpellType::Raid); } void Lua_Bot::SetSpellDurationRaid(int spell_id, int duration) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Raid); + self->SetSpellDuration(spell_id, duration, -1, ApplySpellType::Raid); } -void Lua_Bot::SetSpellDurationRaid(int spell_id, int duration, bool allow_pets) { +void Lua_Bot::SetSpellDurationRaid(int spell_id, int duration, int level) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Raid, allow_pets); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Raid); } -void Lua_Bot::SetSpellDurationRaid(int spell_id, int duration, bool allow_pets, bool is_raid_group_only) { +void Lua_Bot::SetSpellDurationRaid(int spell_id, int duration, int level, bool allow_pets) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Raid, allow_pets, is_raid_group_only); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Raid, allow_pets); +} + +void Lua_Bot::SetSpellDurationRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only) { + Lua_Safe_Call_Void(); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Raid, allow_pets, is_raid_group_only); } int Lua_Bot::CountAugmentEquippedByID(uint32 item_id) { @@ -555,14 +584,20 @@ luabind::scope lua_register_bot() { .def("AddItem", (void(Lua_Bot::*)(luabind::adl::object))&Lua_Bot::AddItem) .def("ApplySpell", (void(Lua_Bot::*)(int))&Lua_Bot::ApplySpell) .def("ApplySpell", (void(Lua_Bot::*)(int,int))&Lua_Bot::ApplySpell) - .def("ApplySpell", (void(Lua_Bot::*)(int,int,bool))&Lua_Bot::ApplySpell) + .def("ApplySpell", (void(Lua_Bot::*)(int,int,int))&Lua_Bot::ApplySpell) + .def("ApplySpell", (void(Lua_Bot::*)(int,int,int,bool))&Lua_Bot::ApplySpell) + .def("ApplySpell", (void(Lua_Bot::*)(int,int,int,bool))&Lua_Bot::ApplySpell) .def("ApplySpellGroup", (void(Lua_Bot::*)(int))&Lua_Bot::ApplySpellGroup) .def("ApplySpellGroup", (void(Lua_Bot::*)(int,int))&Lua_Bot::ApplySpellGroup) - .def("ApplySpellGroup", (void(Lua_Bot::*)(int,int,bool))&Lua_Bot::ApplySpellGroup) + .def("ApplySpellGroup", (void(Lua_Bot::*)(int,int,int))&Lua_Bot::ApplySpellGroup) + .def("ApplySpellGroup", (void(Lua_Bot::*)(int,int,int,bool))&Lua_Bot::ApplySpellGroup) + .def("ApplySpellGroup", (void(Lua_Bot::*)(int,int,int,bool))&Lua_Bot::ApplySpellGroup) .def("ApplySpellRaid", (void(Lua_Bot::*)(int))&Lua_Bot::ApplySpellRaid) .def("ApplySpellRaid", (void(Lua_Bot::*)(int,int))&Lua_Bot::ApplySpellRaid) - .def("ApplySpellRaid", (void(Lua_Bot::*)(int,int,bool))&Lua_Bot::ApplySpellRaid) - .def("ApplySpellRaid", (void(Lua_Bot::*)(int,int,bool,bool))&Lua_Bot::ApplySpellRaid) + .def("ApplySpellRaid", (void(Lua_Bot::*)(int,int,int))&Lua_Bot::ApplySpellRaid) + .def("ApplySpellRaid", (void(Lua_Bot::*)(int,int,int,bool))&Lua_Bot::ApplySpellRaid) + .def("ApplySpellRaid", (void(Lua_Bot::*)(int,int,int,bool,bool))&Lua_Bot::ApplySpellRaid) + .def("ApplySpellRaid", (void(Lua_Bot::*)(int,int,int,bool,bool))&Lua_Bot::ApplySpellRaid) .def("Camp", (void(Lua_Bot::*)(void))&Lua_Bot::Camp) .def("Camp", (void(Lua_Bot::*)(bool))&Lua_Bot::Camp) .def("CountBotItem", (uint32(Lua_Bot::*)(uint32))&Lua_Bot::CountBotItem) @@ -622,14 +657,17 @@ luabind::scope lua_register_bot() { .def("SetExpansionBitmask", (void(Lua_Bot::*)(int,bool))&Lua_Bot::SetExpansionBitmask) .def("SetSpellDuration", (void(Lua_Bot::*)(int))&Lua_Bot::SetSpellDuration) .def("SetSpellDuration", (void(Lua_Bot::*)(int,int))&Lua_Bot::SetSpellDuration) - .def("SetSpellDuration", (void(Lua_Bot::*)(int,int,bool))&Lua_Bot::SetSpellDuration) + .def("SetSpellDuration", (void(Lua_Bot::*)(int,int,int))&Lua_Bot::SetSpellDuration) + .def("SetSpellDuration", (void(Lua_Bot::*)(int,int,int,bool))&Lua_Bot::SetSpellDuration) .def("SetSpellDurationGroup", (void(Lua_Bot::*)(int))&Lua_Bot::SetSpellDurationGroup) .def("SetSpellDurationGroup", (void(Lua_Bot::*)(int,int))&Lua_Bot::SetSpellDurationGroup) - .def("SetSpellDurationGroup", (void(Lua_Bot::*)(int,int,bool))&Lua_Bot::SetSpellDurationGroup) + .def("SetSpellDurationGroup", (void(Lua_Bot::*)(int,int,int))&Lua_Bot::SetSpellDurationGroup) + .def("SetSpellDurationGroup", (void(Lua_Bot::*)(int,int,int,bool))&Lua_Bot::SetSpellDurationGroup) .def("SetSpellDurationRaid", (void(Lua_Bot::*)(int))&Lua_Bot::SetSpellDurationRaid) .def("SetSpellDurationRaid", (void(Lua_Bot::*)(int,int))&Lua_Bot::SetSpellDurationRaid) - .def("SetSpellDurationRaid", (void(Lua_Bot::*)(int,int,bool))&Lua_Bot::SetSpellDurationRaid) - .def("SetSpellDurationRaid", (void(Lua_Bot::*)(int,int,bool,bool))&Lua_Bot::SetSpellDurationRaid) + .def("SetSpellDurationRaid", (void(Lua_Bot::*)(int,int,int))&Lua_Bot::SetSpellDurationRaid) + .def("SetSpellDurationRaid", (void(Lua_Bot::*)(int,int,int,bool))&Lua_Bot::SetSpellDurationRaid) + .def("SetSpellDurationRaid", (void(Lua_Bot::*)(int,int,int,bool,bool))&Lua_Bot::SetSpellDurationRaid) .def("SendPayload", (void(Lua_Bot::*)(int))&Lua_Bot::SendPayload) .def("SendPayload", (void(Lua_Bot::*)(int,std::string))&Lua_Bot::SendPayload) .def("Signal", (void(Lua_Bot::*)(int))&Lua_Bot::Signal) diff --git a/zone/lua_bot.h b/zone/lua_bot.h index 67910a177..d67e9166f 100644 --- a/zone/lua_bot.h +++ b/zone/lua_bot.h @@ -77,29 +77,35 @@ public: void ApplySpell(int spell_id); void ApplySpell(int spell_id, int duration); - void ApplySpell(int spell_id, int duration, bool allow_pets); + void ApplySpell(int spell_id, int duration, int level); + void ApplySpell(int spell_id, int duration, int level, bool allow_pets); void ApplySpellGroup(int spell_id); void ApplySpellGroup(int spell_id, int duration); - void ApplySpellGroup(int spell_id, int duration, bool allow_pets); + void ApplySpellGroup(int spell_id, int duration, int level); + void ApplySpellGroup(int spell_id, int duration, int level, bool allow_pets); void ApplySpellRaid(int spell_id); void ApplySpellRaid(int spell_id, int duration); - void ApplySpellRaid(int spell_id, int duration, bool allow_pets); - void ApplySpellRaid(int spell_id, int duration, bool allow_pets, bool is_raid_group_only); + void ApplySpellRaid(int spell_id, int duration, int level); + void ApplySpellRaid(int spell_id, int duration, int level, bool allow_pets); + void ApplySpellRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only); void SetSpellDuration(int spell_id); void SetSpellDuration(int spell_id, int duration); - void SetSpellDuration(int spell_id, int duration, bool allow_pets); + void SetSpellDuration(int spell_id, int duration, int level); + void SetSpellDuration(int spell_id, int duration, int level, bool allow_pets); void SetSpellDurationGroup(int spell_id); void SetSpellDurationGroup(int spell_id, int duration); - void SetSpellDurationGroup(int spell_id, int duration, bool allow_pets); + void SetSpellDurationGroup(int spell_id, int duration, int level); + void SetSpellDurationGroup(int spell_id, int duration, int level, bool allow_pets); void SetSpellDurationRaid(int spell_id); void SetSpellDurationRaid(int spell_id, int duration); - void SetSpellDurationRaid(int spell_id, int duration, bool allow_pets); - void SetSpellDurationRaid(int spell_id, int duration, bool allow_pets, bool is_raid_group_only); + void SetSpellDurationRaid(int spell_id, int duration, int level); + void SetSpellDurationRaid(int spell_id, int duration, int level, bool allow_pets); + void SetSpellDurationRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only); int CountAugmentEquippedByID(uint32 item_id); int CountItemEquippedByID(uint32 item_id); diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index e5a4549ed..aec1be607 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -2716,59 +2716,74 @@ void Lua_Client::ApplySpell(int spell_id, int duration) { self->ApplySpell(spell_id, duration); } -void Lua_Client::ApplySpell(int spell_id, int duration, bool allow_pets) { +void Lua_Client::ApplySpell(int spell_id, int duration, int level) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Solo, allow_pets); + self->ApplySpell(spell_id, duration, level); } -void Lua_Client::ApplySpell(int spell_id, int duration, bool allow_pets, bool allow_bots) { +void Lua_Client::ApplySpell(int spell_id, int duration, int level, bool allow_pets) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Solo, allow_pets, true, allow_bots); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Solo, allow_pets); +} + +void Lua_Client::ApplySpell(int spell_id, int duration, int level, bool allow_pets, bool allow_bots) { + Lua_Safe_Call_Void(); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Solo, allow_pets, true, allow_bots); } void Lua_Client::ApplySpellGroup(int spell_id) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, 0, ApplySpellType::Group); + self->ApplySpell(spell_id, 0, -1, ApplySpellType::Group); } void Lua_Client::ApplySpellGroup(int spell_id, int duration) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Group); + self->ApplySpell(spell_id, duration, -1, ApplySpellType::Group); } -void Lua_Client::ApplySpellGroup(int spell_id, int duration, bool allow_pets) { +void Lua_Client::ApplySpellGroup(int spell_id, int duration, int level) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Group, allow_pets); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Group); } -void Lua_Client::ApplySpellGroup(int spell_id, int duration, bool allow_pets, bool allow_bots) { +void Lua_Client::ApplySpellGroup(int spell_id, int duration, int level, bool allow_pets) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Group, allow_pets, true, allow_bots); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Group, allow_pets); +} + +void Lua_Client::ApplySpellGroup(int spell_id, int duration, int level, bool allow_pets, bool allow_bots) { + Lua_Safe_Call_Void(); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Group, allow_pets, true, allow_bots); } void Lua_Client::ApplySpellRaid(int spell_id) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, 0, ApplySpellType::Raid); + self->ApplySpell(spell_id, 0, -1, ApplySpellType::Raid); } void Lua_Client::ApplySpellRaid(int spell_id, int duration) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Raid); + self->ApplySpell(spell_id, duration, -1, ApplySpellType::Raid); } -void Lua_Client::ApplySpellRaid(int spell_id, int duration, bool allow_pets) { +void Lua_Client::ApplySpellRaid(int spell_id, int duration, int level) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Raid, allow_pets); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid); } -void Lua_Client::ApplySpellRaid(int spell_id, int duration, bool allow_pets, bool is_raid_group_only) { +void Lua_Client::ApplySpellRaid(int spell_id, int duration, int level, bool allow_pets) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Raid, allow_pets, is_raid_group_only); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid, allow_pets); } -void Lua_Client::ApplySpellRaid(int spell_id, int duration, bool allow_pets, bool is_raid_group_only, bool allow_bots) { +void Lua_Client::ApplySpellRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only) { Lua_Safe_Call_Void(); - self->ApplySpell(spell_id, duration, ApplySpellType::Raid, allow_pets, is_raid_group_only, allow_bots); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid, allow_pets, is_raid_group_only); +} + +void Lua_Client::ApplySpellRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only, bool allow_bots) { + Lua_Safe_Call_Void(); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid, allow_pets, is_raid_group_only, allow_bots); } void Lua_Client::SetSpellDuration(int spell_id) { @@ -2781,59 +2796,74 @@ void Lua_Client::SetSpellDuration(int spell_id, int duration) { self->SetSpellDuration(spell_id, duration); } -void Lua_Client::SetSpellDuration(int spell_id, int duration, bool allow_pets) { +void Lua_Client::SetSpellDuration(int spell_id, int duration, int level) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Solo, allow_pets); + self->SetSpellDuration(spell_id, duration, level); } -void Lua_Client::SetSpellDuration(int spell_id, int duration, bool allow_pets, bool allow_bots) { +void Lua_Client::SetSpellDuration(int spell_id, int duration, int level, bool allow_pets) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Solo, allow_pets, true, allow_bots); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Solo, allow_pets); +} + +void Lua_Client::SetSpellDuration(int spell_id, int duration, int level, bool allow_pets, bool allow_bots) { + Lua_Safe_Call_Void(); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Solo, allow_pets, true, allow_bots); } void Lua_Client::SetSpellDurationGroup(int spell_id) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, 0, ApplySpellType::Group); + self->SetSpellDuration(spell_id, 0, -1, ApplySpellType::Group); } void Lua_Client::SetSpellDurationGroup(int spell_id, int duration) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Group); + self->SetSpellDuration(spell_id, duration, -1, ApplySpellType::Group); } -void Lua_Client::SetSpellDurationGroup(int spell_id, int duration, bool allow_pets) { +void Lua_Client::SetSpellDurationGroup(int spell_id, int duration, int level) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Group, allow_pets); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Group); } -void Lua_Client::SetSpellDurationGroup(int spell_id, int duration, bool allow_pets, bool allow_bots) { +void Lua_Client::SetSpellDurationGroup(int spell_id, int duration, int level, bool allow_pets) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Group, allow_pets, true, allow_bots); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Group, allow_pets); +} + +void Lua_Client::SetSpellDurationGroup(int spell_id, int duration, int level, bool allow_pets, bool allow_bots) { + Lua_Safe_Call_Void(); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Group, allow_pets, true, allow_bots); } void Lua_Client::SetSpellDurationRaid(int spell_id) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, 0, ApplySpellType::Raid); + self->SetSpellDuration(spell_id, 0, -1, ApplySpellType::Raid); } void Lua_Client::SetSpellDurationRaid(int spell_id, int duration) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Raid); + self->SetSpellDuration(spell_id, duration, -1, ApplySpellType::Raid); } -void Lua_Client::SetSpellDurationRaid(int spell_id, int duration, bool allow_pets) { +void Lua_Client::SetSpellDurationRaid(int spell_id, int duration, int level) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Raid, allow_pets); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Raid); } -void Lua_Client::SetSpellDurationRaid(int spell_id, int duration, bool allow_pets, bool is_raid_group_only) { +void Lua_Client::SetSpellDurationRaid(int spell_id, int duration, int level, bool allow_pets) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Raid, allow_pets, is_raid_group_only); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Raid, allow_pets); } -void Lua_Client::SetSpellDurationRaid(int spell_id, int duration, bool allow_pets, bool is_raid_group_only, bool allow_bots) { +void Lua_Client::SetSpellDurationRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only) { Lua_Safe_Call_Void(); - self->SetSpellDuration(spell_id, duration, ApplySpellType::Group, allow_pets, is_raid_group_only, allow_bots); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Raid, allow_pets, is_raid_group_only); +} + +void Lua_Client::SetSpellDurationRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only, bool allow_bots) { + Lua_Safe_Call_Void(); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Group, allow_pets, is_raid_group_only, allow_bots); } void Lua_Client::UpdateAdmin() { @@ -3164,17 +3194,20 @@ luabind::scope lua_register_client() { .def("Admin", (int16(Lua_Client::*)(void))&Lua_Client::Admin) .def("ApplySpell", (void(Lua_Client::*)(int))&Lua_Client::ApplySpell) .def("ApplySpell", (void(Lua_Client::*)(int,int))&Lua_Client::ApplySpell) - .def("ApplySpell", (void(Lua_Client::*)(int,int,bool))&Lua_Client::ApplySpell) - .def("ApplySpell", (void(Lua_Client::*)(int,int,bool,bool))&Lua_Client::ApplySpell) + .def("ApplySpell", (void(Lua_Client::*)(int,int,int))&Lua_Client::ApplySpell) + .def("ApplySpell", (void(Lua_Client::*)(int,int,int,bool))&Lua_Client::ApplySpell) + .def("ApplySpell", (void(Lua_Client::*)(int,int,int,bool,bool))&Lua_Client::ApplySpell) .def("ApplySpellGroup", (void(Lua_Client::*)(int))&Lua_Client::ApplySpellGroup) .def("ApplySpellGroup", (void(Lua_Client::*)(int,int))&Lua_Client::ApplySpellGroup) - .def("ApplySpellGroup", (void(Lua_Client::*)(int,int,bool))&Lua_Client::ApplySpellGroup) - .def("ApplySpellGroup", (void(Lua_Client::*)(int,int,bool,bool))&Lua_Client::ApplySpellGroup) + .def("ApplySpellGroup", (void(Lua_Client::*)(int,int,int))&Lua_Client::ApplySpellGroup) + .def("ApplySpellGroup", (void(Lua_Client::*)(int,int,int,bool))&Lua_Client::ApplySpellGroup) + .def("ApplySpellGroup", (void(Lua_Client::*)(int,int,int,bool,bool))&Lua_Client::ApplySpellGroup) .def("ApplySpellRaid", (void(Lua_Client::*)(int))&Lua_Client::ApplySpellRaid) .def("ApplySpellRaid", (void(Lua_Client::*)(int,int))&Lua_Client::ApplySpellRaid) - .def("ApplySpellRaid", (void(Lua_Client::*)(int,int,bool))&Lua_Client::ApplySpellRaid) - .def("ApplySpellRaid", (void(Lua_Client::*)(int,int,bool,bool))&Lua_Client::ApplySpellRaid) - .def("ApplySpellRaid", (void(Lua_Client::*)(int,int,bool,bool,bool))&Lua_Client::ApplySpellRaid) + .def("ApplySpellRaid", (void(Lua_Client::*)(int,int,int))&Lua_Client::ApplySpellRaid) + .def("ApplySpellRaid", (void(Lua_Client::*)(int,int,int,bool))&Lua_Client::ApplySpellRaid) + .def("ApplySpellRaid", (void(Lua_Client::*)(int,int,int,bool,bool))&Lua_Client::ApplySpellRaid) + .def("ApplySpellRaid", (void(Lua_Client::*)(int,int,int,bool,bool,bool))&Lua_Client::ApplySpellRaid) .def("AssignTask", (void(Lua_Client::*)(int))&Lua_Client::AssignTask) .def("AssignTask", (void(Lua_Client::*)(int,int))&Lua_Client::AssignTask) .def("AssignTask", (void(Lua_Client::*)(int,int,bool))&Lua_Client::AssignTask) @@ -3595,17 +3628,20 @@ luabind::scope lua_register_client() { .def("SetSkillPoints", (void(Lua_Client::*)(int))&Lua_Client::SetSkillPoints) .def("SetSpellDuration", (void(Lua_Client::*)(int))&Lua_Client::SetSpellDuration) .def("SetSpellDuration", (void(Lua_Client::*)(int,int))&Lua_Client::SetSpellDuration) - .def("SetSpellDuration", (void(Lua_Client::*)(int,int,bool))&Lua_Client::SetSpellDuration) - .def("SetSpellDuration", (void(Lua_Client::*)(int,int,bool,bool))&Lua_Client::SetSpellDuration) + .def("SetSpellDuration", (void(Lua_Client::*)(int,int,int))&Lua_Client::SetSpellDuration) + .def("SetSpellDuration", (void(Lua_Client::*)(int,int,int,bool))&Lua_Client::SetSpellDuration) + .def("SetSpellDuration", (void(Lua_Client::*)(int,int,int,bool,bool))&Lua_Client::SetSpellDuration) .def("SetSpellDurationGroup", (void(Lua_Client::*)(int))&Lua_Client::SetSpellDurationGroup) .def("SetSpellDurationGroup", (void(Lua_Client::*)(int,int))&Lua_Client::SetSpellDurationGroup) - .def("SetSpellDurationGroup", (void(Lua_Client::*)(int,int,bool))&Lua_Client::SetSpellDurationGroup) - .def("SetSpellDurationGroup", (void(Lua_Client::*)(int,int,bool,bool))&Lua_Client::SetSpellDurationGroup) + .def("SetSpellDurationGroup", (void(Lua_Client::*)(int,int,int))&Lua_Client::SetSpellDurationGroup) + .def("SetSpellDurationGroup", (void(Lua_Client::*)(int,int,int,bool))&Lua_Client::SetSpellDurationGroup) + .def("SetSpellDurationGroup", (void(Lua_Client::*)(int,int,int,bool,bool))&Lua_Client::SetSpellDurationGroup) .def("SetSpellDurationRaid", (void(Lua_Client::*)(int))&Lua_Client::SetSpellDurationRaid) .def("SetSpellDurationRaid", (void(Lua_Client::*)(int,int))&Lua_Client::SetSpellDurationRaid) - .def("SetSpellDurationRaid", (void(Lua_Client::*)(int,int,bool))&Lua_Client::SetSpellDurationRaid) - .def("SetSpellDurationRaid", (void(Lua_Client::*)(int,int,bool,bool))&Lua_Client::SetSpellDurationRaid) - .def("SetSpellDurationRaid", (void(Lua_Client::*)(int,int,bool,bool,bool))&Lua_Client::SetSpellDurationRaid) + .def("SetSpellDurationRaid", (void(Lua_Client::*)(int,int,int))&Lua_Client::SetSpellDurationRaid) + .def("SetSpellDurationRaid", (void(Lua_Client::*)(int,int,int,bool))&Lua_Client::SetSpellDurationRaid) + .def("SetSpellDurationRaid", (void(Lua_Client::*)(int,int,int,bool,bool))&Lua_Client::SetSpellDurationRaid) + .def("SetSpellDurationRaid", (void(Lua_Client::*)(int,int,int,bool,bool,bool))&Lua_Client::SetSpellDurationRaid) .def("SetStartZone", (void(Lua_Client::*)(int))&Lua_Client::SetStartZone) .def("SetStartZone", (void(Lua_Client::*)(int,float))&Lua_Client::SetStartZone) .def("SetStartZone", (void(Lua_Client::*)(int,float,float))&Lua_Client::SetStartZone) diff --git a/zone/lua_client.h b/zone/lua_client.h index f2c7140ea..7ffca7a04 100644 --- a/zone/lua_client.h +++ b/zone/lua_client.h @@ -483,35 +483,41 @@ public: void ApplySpell(int spell_id); void ApplySpell(int spell_id, int duration); - void ApplySpell(int spell_id, int duration, bool allow_pets); - void ApplySpell(int spell_id, int duration, bool allow_pets, bool allow_bots); + void ApplySpell(int spell_id, int duration, int level); + void ApplySpell(int spell_id, int duration, int level, bool allow_pets); + void ApplySpell(int spell_id, int duration, int level, bool allow_pets, bool allow_bots); void ApplySpellGroup(int spell_id); void ApplySpellGroup(int spell_id, int duration); - void ApplySpellGroup(int spell_id, int duration, bool allow_pets); - void ApplySpellGroup(int spell_id, int duration, bool allow_pets, bool allow_bots); + void ApplySpellGroup(int spell_id, int duration, int level); + void ApplySpellGroup(int spell_id, int duration, int level, bool allow_pets); + void ApplySpellGroup(int spell_id, int duration, int level, bool allow_pets, bool allow_bots); void ApplySpellRaid(int spell_id); void ApplySpellRaid(int spell_id, int duration); - void ApplySpellRaid(int spell_id, int duration, bool allow_pets); - void ApplySpellRaid(int spell_id, int duration, bool allow_pets, bool is_raid_group_only); - void ApplySpellRaid(int spell_id, int duration, bool allow_pets, bool is_raid_group_only, bool allow_bots); + void ApplySpellRaid(int spell_id, int duration, int level); + void ApplySpellRaid(int spell_id, int duration, int level, bool allow_pets); + void ApplySpellRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only); + void ApplySpellRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only, bool allow_bots); void SetSpellDuration(int spell_id); void SetSpellDuration(int spell_id, int duration); - void SetSpellDuration(int spell_id, int duration, bool allow_pets); - void SetSpellDuration(int spell_id, int duration, bool allow_pets, bool allow_bots); + void SetSpellDuration(int spell_id, int duration, int level); + void SetSpellDuration(int spell_id, int duration, int level, bool allow_pets); + void SetSpellDuration(int spell_id, int duration, int level, bool allow_pets, bool allow_bots); void SetSpellDurationGroup(int spell_id); void SetSpellDurationGroup(int spell_id, int duration); - void SetSpellDurationGroup(int spell_id, int duration, bool allow_pets); - void SetSpellDurationGroup(int spell_id, int duration, bool allow_pets, bool allow_bots); + void SetSpellDurationGroup(int spell_id, int duration, int level); + void SetSpellDurationGroup(int spell_id, int duration, int level, bool allow_pets); + void SetSpellDurationGroup(int spell_id, int duration, int level, bool allow_pets, bool allow_bots); void SetSpellDurationRaid(int spell_id); void SetSpellDurationRaid(int spell_id, int duration); - void SetSpellDurationRaid(int spell_id, int duration, bool allow_pets); - void SetSpellDurationRaid(int spell_id, int duration, bool allow_pets, bool is_raid_group_only); - void SetSpellDurationRaid(int spell_id, int duration, bool allow_pets, bool is_raid_group_only, bool allow_bots); + void SetSpellDurationRaid(int spell_id, int duration, int level); + void SetSpellDurationRaid(int spell_id, int duration, int level, bool allow_pets); + void SetSpellDurationRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only); + void SetSpellDurationRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only, bool allow_bots); int GetEnvironmentDamageModifier(); diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index c5535800c..6c5b24c28 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -2532,6 +2532,11 @@ void Lua_Mob::ApplySpellBuff(int spell_id, int duration) { self->ApplySpellBuff(spell_id, duration); } +void Lua_Mob::ApplySpellBuff(int spell_id, int duration, int level) { + Lua_Safe_Call_Void(); + self->ApplySpellBuff(spell_id, level); +} + int Lua_Mob::GetBuffStatValueBySlot(uint8 slot, const char* identifier) { Lua_Safe_Call_Int(); return self->GetBuffStatValueBySlot(slot, identifier); @@ -2552,6 +2557,11 @@ void Lua_Mob::SetBuffDuration(int spell_id, int duration) { self->SetBuffDuration(spell_id, duration); } +void Lua_Mob::SetBuffDuration(int spell_id, int duration, int level) { + Lua_Safe_Call_Void(); + self->SetBuffDuration(spell_id, duration, level); +} + Lua_Mob Lua_Mob::GetUltimateOwner() { Lua_Safe_Call_Class(Lua_Mob); return Lua_Mob(self->GetUltimateOwner()); @@ -3166,7 +3176,8 @@ luabind::scope lua_register_mob() { .def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int64,int64,bool,bool))&Lua_Mob::AddToHateList) .def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int64,int64,bool,bool,bool))&Lua_Mob::AddToHateList) .def("ApplySpellBuff", (void(Lua_Mob::*)(int))&Lua_Mob::ApplySpellBuff) - .def("ApplySpellBuff", (void(Lua_Mob::*)(int, int))&Lua_Mob::ApplySpellBuff) + .def("ApplySpellBuff", (void(Lua_Mob::*)(int,int))&Lua_Mob::ApplySpellBuff) + .def("ApplySpellBuff", (void(Lua_Mob::*)(int,int,int))&Lua_Mob::ApplySpellBuff) .def("Attack", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::Attack) .def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::Attack) .def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool))&Lua_Mob::Attack) @@ -3613,7 +3624,8 @@ luabind::scope lua_register_mob() { .def("SetBucket", (void(Lua_Mob::*)(std::string,std::string))&Lua_Mob::SetBucket) .def("SetBucket", (void(Lua_Mob::*)(std::string,std::string,std::string))&Lua_Mob::SetBucket) .def("SetBuffDuration", (void(Lua_Mob::*)(int))&Lua_Mob::SetBuffDuration) - .def("SetBuffDuration", (void(Lua_Mob::*)(int, int))&Lua_Mob::SetBuffDuration) + .def("SetBuffDuration", (void(Lua_Mob::*)(int,int))&Lua_Mob::SetBuffDuration) + .def("SetBuffDuration", (void(Lua_Mob::*)(int,int,int))&Lua_Mob::SetBuffDuration) .def("SetCurrentWP", &Lua_Mob::SetCurrentWP) .def("SetDestructibleObject", (void(Lua_Mob::*)(bool))&Lua_Mob::SetDestructibleObject) .def("SetDisableMelee", (void(Lua_Mob::*)(bool))&Lua_Mob::SetDisableMelee) diff --git a/zone/lua_mob.h b/zone/lua_mob.h index 68825325b..36b0d7180 100644 --- a/zone/lua_mob.h +++ b/zone/lua_mob.h @@ -481,10 +481,12 @@ public: bool CanRaceEquipItem(uint32 item_id); void ApplySpellBuff(int spell_id); void ApplySpellBuff(int spell_id, int duration); + void ApplySpellBuff(int spell_id, int duration, int level); int GetBuffStatValueBySlot(uint8 slot, const char* identifier); int GetBuffStatValueBySpell(int spell_id, const char* identifier); void SetBuffDuration(int spell_id); void SetBuffDuration(int spell_id, int duration); + void SetBuffDuration(int spell_id, int duration, int level); void CloneAppearance(Lua_Mob other); void CloneAppearance(Lua_Mob other, bool clone_name); void DamageArea(int64 damage); diff --git a/zone/mob.h b/zone/mob.h index 7ec810bee..57658eb4e 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -497,8 +497,8 @@ public: void ListAppearanceEffects(Client* c); void ClearAppearenceEffects(); void SendSavedAppearenceEffects(Client *receiver); - void SetBuffDuration(int spell_id, int duration = 0); - void ApplySpellBuff(int spell_id, int duration = 0); + void SetBuffDuration(int spell_id, int duration = 0, int level_override = -1); + void ApplySpellBuff(int spell_id, int duration = 0, int level_override = -1); int GetBuffStatValueBySpell(int32 spell_id, const char* stat_identifier); int GetBuffStatValueBySlot(uint8 slot, const char* stat_identifier); diff --git a/zone/perl_bot.cpp b/zone/perl_bot.cpp index dd4c40fd4..84b7d36eb 100644 --- a/zone/perl_bot.cpp +++ b/zone/perl_bot.cpp @@ -65,24 +65,59 @@ void Perl_Bot_ApplySpell(Bot* self, int spell_id, int duration) self->ApplySpell(spell_id, duration); } -void Perl_Bot_ApplySpell(Bot* self, int spell_id, int duration, bool allow_pets) +void Perl_Bot_ApplySpell(Bot* self, int spell_id, int duration, int level) { - self->ApplySpell(spell_id, duration, ApplySpellType::Solo, allow_pets); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Solo); +} + +void Perl_Bot_ApplySpell(Bot* self, int spell_id, int duration, int level, bool allow_pets) +{ + self->ApplySpell(spell_id, duration, level, ApplySpellType::Solo, allow_pets); } void Perl_Bot_ApplySpellGroup(Bot* self, int spell_id) { - self->ApplySpell(spell_id, 0, ApplySpellType::Group); + self->ApplySpell(spell_id, 0, -1, ApplySpellType::Group); } void Perl_Bot_ApplySpellGroup(Bot* self, int spell_id, int duration) { - self->ApplySpell(spell_id, duration, ApplySpellType::Group); + self->ApplySpell(spell_id, duration, -1, ApplySpellType::Group); } -void Perl_Bot_ApplySpellGroup(Bot* self, int spell_id, int duration, bool allow_pets) +void Perl_Bot_ApplySpellGroup(Bot* self, int spell_id, int duration, int level) { - self->ApplySpell(spell_id, duration, ApplySpellType::Group, allow_pets); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Group); +} + +void Perl_Bot_ApplySpellGroup(Bot* self, int spell_id, int duration, int level, bool allow_pets) +{ + self->ApplySpell(spell_id, duration, level, ApplySpellType::Group, allow_pets); +} + +void Perl_Bot_ApplySpellRaid(Bot* self, int spell_id) +{ + self->ApplySpell(spell_id, 0, -1, ApplySpellType::Raid); +} + +void Perl_Bot_ApplySpellRaid(Bot* self, int spell_id, int duration) +{ + self->ApplySpell(spell_id, duration, -1, ApplySpellType::Raid); +} + +void Perl_Bot_ApplySpellRaid(Bot* self, int spell_id, int duration, int level) +{ + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid); +} + +void Perl_Bot_ApplySpellRaid(Bot* self, int spell_id, int duration, int level, bool allow_pets) +{ + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid, allow_pets); +} + +void Perl_Bot_ApplySpellRaid(Bot* self, int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only) +{ + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid, allow_pets, is_raid_group_only); } uint32 Perl_Bot_CountBotItem(Bot* self, uint32 item_id) @@ -315,24 +350,59 @@ void Perl_Bot_SetSpellDuration(Bot* self, int spell_id, int duration) self->SetSpellDuration(spell_id, duration); } -void Perl_Bot_SetSpellDuration(Bot* self, int spell_id, int duration, bool allow_pets) +void Perl_Bot_SetSpellDuration(Bot* self, int spell_id, int duration, int level) { - self->SetSpellDuration(spell_id, duration, ApplySpellType::Solo, allow_pets); + self->SetSpellDuration(spell_id, duration); +} + +void Perl_Bot_SetSpellDuration(Bot* self, int spell_id, int duration, int level, bool allow_pets) +{ + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Solo, allow_pets); } void Perl_Bot_SetSpellDurationGroup(Bot* self, int spell_id) { - self->SetSpellDuration(spell_id, 0, ApplySpellType::Group); + self->SetSpellDuration(spell_id, 0, -1, ApplySpellType::Group); } void Perl_Bot_SetSpellDurationGroup(Bot* self, int spell_id, int duration) { - self->SetSpellDuration(spell_id, duration, ApplySpellType::Group); + self->SetSpellDuration(spell_id, duration, -1, ApplySpellType::Group); } -void Perl_Bot_SetSpellDurationGroup(Bot* self, int spell_id, int duration, bool allow_pets) +void Perl_Bot_SetSpellDurationGroup(Bot* self, int spell_id, int duration, int level) { - self->SetSpellDuration(spell_id, duration, ApplySpellType::Group, allow_pets); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Group); +} + +void Perl_Bot_SetSpellDurationGroup(Bot* self, int spell_id, int duration, int level, bool allow_pets) +{ + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Group, allow_pets); +} + +void Perl_Bot_SetSpellDurationRaid(Bot* self, int spell_id) +{ + self->SetSpellDuration(spell_id, 0, -1, ApplySpellType::Raid); +} + +void Perl_Bot_SetSpellDurationRaid(Bot* self, int spell_id, int duration) +{ + self->SetSpellDuration(spell_id, duration, -1, ApplySpellType::Raid); +} + +void Perl_Bot_SetSpellDurationRaid(Bot* self, int spell_id, int duration, int level) +{ + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Raid); +} + +void Perl_Bot_SetSpellDurationRaid(Bot* self, int spell_id, int duration, int level, bool allow_pets) +{ + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Raid, allow_pets); +} + +void Perl_Bot_SetSpellDurationRaid(Bot* self, int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only) +{ + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Raid, allow_pets, is_raid_group_only); } bool Perl_Bot_ReloadBotDataBuckets(Bot* self) @@ -473,10 +543,17 @@ void perl_register_bot() package.add("AddItem", &Perl_Bot_AddItem); package.add("ApplySpell", (void(*)(Bot*, int))&Perl_Bot_ApplySpell); package.add("ApplySpell", (void(*)(Bot*, int, int))&Perl_Bot_ApplySpell); - package.add("ApplySpell", (void(*)(Bot*, int, int, bool))&Perl_Bot_ApplySpell); + package.add("ApplySpell", (void(*)(Bot*, int, int, int))&Perl_Bot_ApplySpell); + package.add("ApplySpell", (void(*)(Bot*, int, int, int, bool))&Perl_Bot_ApplySpell); package.add("ApplySpellGroup", (void(*)(Bot*, int))&Perl_Bot_ApplySpellGroup); package.add("ApplySpellGroup", (void(*)(Bot*, int, int))&Perl_Bot_ApplySpellGroup); - package.add("ApplySpellGroup", (void(*)(Bot*, int, int, bool))&Perl_Bot_ApplySpellGroup); + package.add("ApplySpellGroup", (void(*)(Bot*, int, int, int))&Perl_Bot_ApplySpellGroup); + package.add("ApplySpellGroup", (void(*)(Bot*, int, int, int, bool))&Perl_Bot_ApplySpellGroup); + package.add("ApplySpellRaid", (void(*)(Bot*, int))&Perl_Bot_ApplySpellRaid); + package.add("ApplySpellRaid", (void(*)(Bot*, int, int))&Perl_Bot_ApplySpellRaid); + package.add("ApplySpellRaid", (void(*)(Bot*, int, int, int))&Perl_Bot_ApplySpellRaid); + package.add("ApplySpellRaid", (void(*)(Bot*, int, int, int, bool))&Perl_Bot_ApplySpellRaid); + package.add("ApplySpellRaid", (void(*)(Bot*, int, int, int, bool, bool))&Perl_Bot_ApplySpellRaid); package.add("Camp", (void(*)(Bot*))&Perl_Bot_Camp); package.add("Camp", (void(*)(Bot*, bool))&Perl_Bot_Camp); package.add("CountAugmentEquippedByID", &Perl_Bot_CountAugmentEquippedByID); @@ -533,10 +610,17 @@ void perl_register_bot() package.add("SetExpansionBitmask", (void(*)(Bot*, int, bool))&Perl_Bot_SetExpansionBitmask); package.add("SetSpellDuration", (void(*)(Bot*, int))&Perl_Bot_SetSpellDuration); package.add("SetSpellDuration", (void(*)(Bot*, int, int))&Perl_Bot_SetSpellDuration); - package.add("SetSpellDuration", (void(*)(Bot*, int, int, bool))&Perl_Bot_SetSpellDuration); + package.add("SetSpellDuration", (void(*)(Bot*, int, int, int))&Perl_Bot_SetSpellDuration); + package.add("SetSpellDuration", (void(*)(Bot*, int, int, int, bool))&Perl_Bot_SetSpellDuration); package.add("SetSpellDurationGroup", (void(*)(Bot*, int))&Perl_Bot_SetSpellDurationGroup); package.add("SetSpellDurationGroup", (void(*)(Bot*, int, int))&Perl_Bot_SetSpellDurationGroup); - package.add("SetSpellDurationGroup", (void(*)(Bot*, int, int, bool))&Perl_Bot_SetSpellDurationGroup); + package.add("SetSpellDurationGroup", (void(*)(Bot*, int, int, int))&Perl_Bot_SetSpellDurationGroup); + package.add("SetSpellDurationGroup", (void(*)(Bot*, int, int, int, bool))&Perl_Bot_SetSpellDurationGroup); + package.add("SetSpellDurationRaid", (void(*)(Bot*, int))&Perl_Bot_SetSpellDurationRaid); + package.add("SetSpellDurationRaid", (void(*)(Bot*, int, int))&Perl_Bot_SetSpellDurationRaid); + package.add("SetSpellDurationRaid", (void(*)(Bot*, int, int, int))&Perl_Bot_SetSpellDurationRaid); + package.add("SetSpellDurationRaid", (void(*)(Bot*, int, int, int, bool))&Perl_Bot_SetSpellDurationRaid); + package.add("SetSpellDurationRaid", (void(*)(Bot*, int, int, int, bool, bool))&Perl_Bot_SetSpellDurationRaid); package.add("Signal", &Perl_Bot_Signal); package.add("Sit", &Perl_Bot_Sit); package.add("Stand", &Perl_Bot_Stand); diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 64c11b965..60de6dcdc 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -2616,59 +2616,74 @@ void Perl_Client_ApplySpell(Client* self, int spell_id, int duration) self->ApplySpell(spell_id, duration); } -void Perl_Client_ApplySpell(Client* self, int spell_id, int duration, bool allow_pets) +void Perl_Client_ApplySpell(Client* self, int spell_id, int duration, int level) { - self->ApplySpell(spell_id, duration, ApplySpellType::Solo, allow_pets); + self->ApplySpell(spell_id, duration, level); } -void Perl_Client_ApplySpell(Client* self, int spell_id, int duration, bool allow_pets, bool allow_bots) +void Perl_Client_ApplySpell(Client* self, int spell_id, int duration, int level, bool allow_pets) { - self->ApplySpell(spell_id, duration, ApplySpellType::Solo, allow_pets, true, allow_bots); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Solo, allow_pets); +} + +void Perl_Client_ApplySpell(Client* self, int spell_id, int duration, int level, bool allow_pets, bool allow_bots) +{ + self->ApplySpell(spell_id, duration, level, ApplySpellType::Solo, allow_pets, true, allow_bots); } void Perl_Client_ApplySpellGroup(Client* self, int spell_id) { - self->ApplySpell(spell_id, 0, ApplySpellType::Group); + self->ApplySpell(spell_id, 0, -1, ApplySpellType::Group); } void Perl_Client_ApplySpellGroup(Client* self, int spell_id, int duration) { - self->ApplySpell(spell_id, duration, ApplySpellType::Group); + self->ApplySpell(spell_id, duration, -1, ApplySpellType::Group); } -void Perl_Client_ApplySpellGroup(Client* self, int spell_id, int duration, bool allow_pets) +void Perl_Client_ApplySpellGroup(Client* self, int spell_id, int duration, int level) { - self->ApplySpell(spell_id, duration, ApplySpellType::Group, allow_pets); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Group); } -void Perl_Client_ApplySpellGroup(Client* self, int spell_id, int duration, bool allow_pets, bool allow_bots) +void Perl_Client_ApplySpellGroup(Client* self, int spell_id, int duration, int level, bool allow_pets) { - self->ApplySpell(spell_id, duration, ApplySpellType::Group, allow_pets, true, allow_bots); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Group, allow_pets); +} + +void Perl_Client_ApplySpellGroup(Client* self, int spell_id, int duration, int level, bool allow_pets, bool allow_bots) +{ + self->ApplySpell(spell_id, duration, level, ApplySpellType::Group, allow_pets, true, allow_bots); } void Perl_Client_ApplySpellRaid(Client* self, int spell_id) { - self->ApplySpell(spell_id, 0, ApplySpellType::Raid); + self->ApplySpell(spell_id, 0, -1, ApplySpellType::Raid); } void Perl_Client_ApplySpellRaid(Client* self, int spell_id, int duration) { - self->ApplySpell(spell_id, duration, ApplySpellType::Raid); + self->ApplySpell(spell_id, duration, -1, ApplySpellType::Raid); } -void Perl_Client_ApplySpellRaid(Client* self, int spell_id, int duration, bool allow_pets) +void Perl_Client_ApplySpellRaid(Client* self, int spell_id, int duration, int level) { - self->ApplySpell(spell_id, duration, ApplySpellType::Raid, allow_pets); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid); } -void Perl_Client_ApplySpellRaid(Client* self, int spell_id, int duration, bool allow_pets, bool is_raid_group_only) +void Perl_Client_ApplySpellRaid(Client* self, int spell_id, int duration, int level, bool allow_pets) { - self->ApplySpell(spell_id, duration, ApplySpellType::Raid, allow_pets, is_raid_group_only); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid, allow_pets); } -void Perl_Client_ApplySpellRaid(Client* self, int spell_id, int duration, bool allow_pets, bool is_raid_group_only, bool allow_bots) +void Perl_Client_ApplySpellRaid(Client* self, int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only) { - self->ApplySpell(spell_id, duration, ApplySpellType::Raid, allow_pets, is_raid_group_only, allow_bots); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid, allow_pets, is_raid_group_only); +} + +void Perl_Client_ApplySpellRaid(Client* self, int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only, bool allow_bots) +{ + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid, allow_pets, is_raid_group_only, allow_bots); } void Perl_Client_SetSpellDuration(Client* self, int spell_id) @@ -2681,59 +2696,74 @@ void Perl_Client_SetSpellDuration(Client* self, int spell_id, int duration) self->SetSpellDuration(spell_id, duration); } -void Perl_Client_SetSpellDuration(Client* self, int spell_id, int duration, bool allow_pets) +void Perl_Client_SetSpellDuration(Client* self, int spell_id, int duration, int level) { - self->SetSpellDuration(spell_id, duration, ApplySpellType::Solo, allow_pets); + self->SetSpellDuration(spell_id, duration, level); } -void Perl_Client_SetSpellDuration(Client* self, int spell_id, int duration, bool allow_pets, bool allow_bots) +void Perl_Client_SetSpellDuration(Client* self, int spell_id, int duration, int level, bool allow_pets) { - self->SetSpellDuration(spell_id, duration, ApplySpellType::Solo, allow_pets, true, allow_bots); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Solo, allow_pets); +} + +void Perl_Client_SetSpellDuration(Client* self, int spell_id, int duration, int level, bool allow_pets, bool allow_bots) +{ + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Solo, allow_pets, true, allow_bots); } void Perl_Client_SetSpellDurationGroup(Client* self, int spell_id) { - self->SetSpellDuration(spell_id, 0, ApplySpellType::Group); + self->SetSpellDuration(spell_id, 0, -1, ApplySpellType::Group); } void Perl_Client_SetSpellDurationGroup(Client* self, int spell_id, int duration) { - self->SetSpellDuration(spell_id, duration, ApplySpellType::Group); + self->SetSpellDuration(spell_id, duration, -1, ApplySpellType::Group); } -void Perl_Client_SetSpellDurationGroup(Client* self, int spell_id, int duration, bool allow_pets) +void Perl_Client_SetSpellDurationGroup(Client* self, int spell_id, int duration, int level) { - self->SetSpellDuration(spell_id, duration, ApplySpellType::Group, allow_pets); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Group); } -void Perl_Client_SetSpellDurationGroup(Client* self, int spell_id, int duration, bool allow_pets, bool allow_bots) +void Perl_Client_SetSpellDurationGroup(Client* self, int spell_id, int duration, int level, bool allow_pets) { - self->SetSpellDuration(spell_id, duration, ApplySpellType::Group, allow_pets, true, allow_bots); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Group, allow_pets); +} + +void Perl_Client_SetSpellDurationGroup(Client* self, int spell_id, int duration, int level, bool allow_pets, bool allow_bots) +{ + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Group, allow_pets, true, allow_bots); } void Perl_Client_SetSpellDurationRaid(Client* self, int spell_id) { - self->ApplySpell(spell_id, 0, ApplySpellType::Raid); + self->ApplySpell(spell_id, 0, -1, ApplySpellType::Raid); } void Perl_Client_SetSpellDurationRaid(Client* self, int spell_id, int duration) { - self->ApplySpell(spell_id, duration, ApplySpellType::Raid); + self->ApplySpell(spell_id, duration, -1, ApplySpellType::Raid); } -void Perl_Client_SetSpellDurationRaid(Client* self, int spell_id, int duration, bool allow_pets) +void Perl_Client_SetSpellDurationRaid(Client* self, int spell_id, int duration, int level) { - self->SetSpellDuration(spell_id, duration, ApplySpellType::Raid, allow_pets); + self->ApplySpell(spell_id, duration, level, ApplySpellType::Raid); } -void Perl_Client_SetSpellDurationRaid(Client* self, int spell_id, int duration, bool allow_pets, bool is_raid_group_only) +void Perl_Client_SetSpellDurationRaid(Client* self, int spell_id, int duration, int level, bool allow_pets) { - self->SetSpellDuration(spell_id, duration, ApplySpellType::Raid, allow_pets, is_raid_group_only); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Raid, allow_pets); } -void Perl_Client_SetSpellDurationRaid(Client* self, int spell_id, int duration, bool allow_pets, bool is_raid_group_only, bool allow_bots) +void Perl_Client_SetSpellDurationRaid(Client* self, int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only) { - self->SetSpellDuration(spell_id, duration, ApplySpellType::Raid, allow_pets, is_raid_group_only, allow_bots); + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Raid, allow_pets, is_raid_group_only); +} + +void Perl_Client_SetSpellDurationRaid(Client* self, int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only, bool allow_bots) +{ + self->SetSpellDuration(spell_id, duration, level, ApplySpellType::Raid, allow_pets, is_raid_group_only, allow_bots); } perl::array Perl_Client_GetPEQZoneFlags(Client* self) @@ -2985,17 +3015,20 @@ void perl_register_client() package.add("Admin", &Perl_Client_Admin); package.add("ApplySpell", (void(*)(Client*, int))&Perl_Client_ApplySpell); package.add("ApplySpell", (void(*)(Client*, int, int))&Perl_Client_ApplySpell); - package.add("ApplySpell", (void(*)(Client*, int, int, bool))&Perl_Client_ApplySpell); - package.add("ApplySpell", (void(*)(Client*, int, int, bool, bool))&Perl_Client_ApplySpell); + package.add("ApplySpell", (void(*)(Client*, int, int, int))&Perl_Client_ApplySpell); + package.add("ApplySpell", (void(*)(Client*, int, int, int, bool))&Perl_Client_ApplySpell); + package.add("ApplySpell", (void(*)(Client*, int, int, int, bool, bool))&Perl_Client_ApplySpell); package.add("ApplySpellGroup", (void(*)(Client*, int))&Perl_Client_ApplySpellGroup); package.add("ApplySpellGroup", (void(*)(Client*, int, int))&Perl_Client_ApplySpellGroup); - package.add("ApplySpellGroup", (void(*)(Client*, int, int, bool))&Perl_Client_ApplySpellGroup); - package.add("ApplySpellGroup", (void(*)(Client*, int, int, bool, bool))&Perl_Client_ApplySpellGroup); + package.add("ApplySpellGroup", (void(*)(Client*, int, int, int))&Perl_Client_ApplySpellGroup); + package.add("ApplySpellGroup", (void(*)(Client*, int, int, int, bool))&Perl_Client_ApplySpellGroup); + package.add("ApplySpellGroup", (void(*)(Client*, int, int, int, bool, bool))&Perl_Client_ApplySpellGroup); package.add("ApplySpellRaid", (void(*)(Client*, int))&Perl_Client_ApplySpellRaid); package.add("ApplySpellRaid", (void(*)(Client*, int, int))&Perl_Client_ApplySpellRaid); - package.add("ApplySpellRaid", (void(*)(Client*, int, int, bool))&Perl_Client_ApplySpellRaid); - package.add("ApplySpellRaid", (void(*)(Client*, int, int, bool, bool))&Perl_Client_ApplySpellRaid); - package.add("ApplySpellRaid", (void(*)(Client*, int, int, bool, bool, bool))&Perl_Client_ApplySpellRaid); + package.add("ApplySpellRaid", (void(*)(Client*, int, int, int))&Perl_Client_ApplySpellRaid); + package.add("ApplySpellRaid", (void(*)(Client*, int, int, int, bool))&Perl_Client_ApplySpellRaid); + package.add("ApplySpellRaid", (void(*)(Client*, int, int, int, bool, bool))&Perl_Client_ApplySpellRaid); + package.add("ApplySpellRaid", (void(*)(Client*, int, int, int, bool, bool, bool))&Perl_Client_ApplySpellRaid); package.add("AssignTask", (void(*)(Client*, int))&Perl_Client_AssignTask); package.add("AssignTask", (void(*)(Client*, int, int))&Perl_Client_AssignTask); package.add("AssignTask", (void(*)(Client*, int, int, bool))&Perl_Client_AssignTask); @@ -3410,17 +3443,21 @@ void perl_register_client() package.add("SetSkillPoints", &Perl_Client_SetSkillPoints); package.add("SetSpellDuration", (void(*)(Client*, int))&Perl_Client_SetSpellDuration); package.add("SetSpellDuration", (void(*)(Client*, int, int))&Perl_Client_SetSpellDuration); - package.add("SetSpellDuration", (void(*)(Client*, int, int, bool))&Perl_Client_SetSpellDuration); - package.add("SetSpellDuration", (void(*)(Client*, int, int, bool, bool))&Perl_Client_SetSpellDuration); + package.add("SetSpellDuration", (void(*)(Client*, int, int, int))&Perl_Client_SetSpellDuration); + package.add("SetSpellDuration", (void(*)(Client*, int, int, int, bool))&Perl_Client_SetSpellDuration); + package.add("SetSpellDuration", (void(*)(Client*, int, int, int, bool, bool))&Perl_Client_SetSpellDuration); package.add("SetSpellDurationGroup", (void(*)(Client*, int))&Perl_Client_SetSpellDurationGroup); package.add("SetSpellDurationGroup", (void(*)(Client*, int, int))&Perl_Client_SetSpellDurationGroup); - package.add("SetSpellDurationGroup", (void(*)(Client*, int, int, bool))&Perl_Client_SetSpellDurationGroup); - package.add("SetSpellDurationGroup", (void(*)(Client*, int, int, bool, bool))&Perl_Client_SetSpellDurationGroup); + package.add("SetSpellDurationGroup", (void(*)(Client*, int, int, int))&Perl_Client_SetSpellDurationGroup); + package.add("SetSpellDurationGroup", (void(*)(Client*, int, int, int, bool))&Perl_Client_SetSpellDurationGroup); + package.add("SetSpellDurationGroup", (void(*)(Client*, int, int, int, bool, bool))&Perl_Client_SetSpellDurationGroup); package.add("SetSpellDurationRaid", (void(*)(Client*, int))&Perl_Client_SetSpellDurationRaid); package.add("SetSpellDurationRaid", (void(*)(Client*, int, int))&Perl_Client_SetSpellDurationRaid); - package.add("SetSpellDurationRaid", (void(*)(Client*, int, int, bool))&Perl_Client_SetSpellDurationRaid); - package.add("SetSpellDurationRaid", (void(*)(Client*, int, int, bool, bool))&Perl_Client_SetSpellDurationRaid); - package.add("SetSpellDurationRaid", (void(*)(Client*, int, int, bool, bool, bool))&Perl_Client_SetSpellDurationRaid); + package.add("SetSpellDurationRaid", (void(*)(Client*, int, int, int))&Perl_Client_SetSpellDurationRaid); + package.add("SetSpellDurationRaid", (void(*)(Client*, int, int, int, bool))&Perl_Client_SetSpellDurationRaid); + package.add("SetSpellDurationRaid", (void(*)(Client*, int, int, int, bool, bool))&Perl_Client_SetSpellDurationRaid); + package.add("SetSpellDurationRaid", (void(*)(Client*, int, int, int, bool, bool, bool))&Perl_Client_SetSpellDurationRaid); + package.add("SetSpellDurationRaid", (void(*)(Client*, int, int, int, bool, bool, bool))&Perl_Client_SetSpellDurationRaid); package.add("SetStartZone", (void(*)(Client*, uint32))&Perl_Client_SetStartZone); package.add("SetStartZone", (void(*)(Client*, uint32, float, float, float))&Perl_Client_SetStartZone); package.add("SetStartZone", (void(*)(Client*, uint32, float, float, float, float))&Perl_Client_SetStartZone); diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index bb7a695f5..b556a06fc 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -2880,6 +2880,11 @@ void Perl_Mob_SetBuffDuration(Mob* self, int spell_id, int duration) // @categor self->SetBuffDuration(spell_id, duration); } +void Perl_Mob_SetBuffDuration(Mob* self, int spell_id, int duration, int level) // @categories Script Utility, Spells and Disciplines +{ + self->SetBuffDuration(spell_id, duration, level); +} + void Perl_Mob_ApplySpellBuff(Mob* self, int spell_id) // @categories Script Utility, Spells and Disciplines { self->ApplySpellBuff(spell_id); @@ -2890,6 +2895,11 @@ void Perl_Mob_ApplySpellBuff(Mob* self, int spell_id, int duration) // @categori self->ApplySpellBuff(spell_id, duration); } +void Perl_Mob_ApplySpellBuff(Mob* self, int spell_id, int duration, int level) // @categories Script Utility, Spells and Disciplines +{ + self->ApplySpellBuff(spell_id, duration, level); +} + int Perl_Mob_GetSkillDmgAmt(Mob* self, int skill_id) { return self->GetSkillDmgAmt(skill_id); @@ -3436,6 +3446,7 @@ void perl_register_mob() package.add("AddToHateList", (void(*)(Mob*, Mob*, int64_t, int64_t, bool, bool, bool))&Perl_Mob_AddToHateList); package.add("ApplySpellBuff", (void(*)(Mob*, int))&Perl_Mob_ApplySpellBuff); package.add("ApplySpellBuff", (void(*)(Mob*, int, int))&Perl_Mob_ApplySpellBuff); + package.add("ApplySpellBuff", (void(*)(Mob*, int, int, int))&Perl_Mob_ApplySpellBuff); package.add("Attack", (bool(*)(Mob*, Mob*))&Perl_Mob_Attack); package.add("Attack", (bool(*)(Mob*, Mob*, int))&Perl_Mob_Attack); package.add("Attack", (bool(*)(Mob*, Mob*, int, bool))&Perl_Mob_Attack); @@ -3927,6 +3938,7 @@ void perl_register_mob() package.add("SetBucket", (void(*)(Mob*, std::string, std::string, std::string))&Perl_Mob_SetBucket); package.add("SetBuffDuration", (void(*)(Mob*, int))&Perl_Mob_SetBuffDuration); package.add("SetBuffDuration", (void(*)(Mob*, int, int))&Perl_Mob_SetBuffDuration); + package.add("SetBuffDuration", (void(*)(Mob*, int, int, int))&Perl_Mob_SetBuffDuration); package.add("SetCurrentWP", &Perl_Mob_SetCurrentWP); package.add("SetDeltas", &Perl_Mob_SetDeltas); package.add("SetDisableMelee", &Perl_Mob_SetDisableMelee); diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 488e20609..c73f73e4f 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -10378,7 +10378,7 @@ bool Mob::HasPersistDeathIllusion(int32 spell_id) { return false; } -void Mob::SetBuffDuration(int spell_id, int duration) { +void Mob::SetBuffDuration(int spell_id, int duration, int level) { /* Will refresh the buff with specified spell_id to the specified duration @@ -10402,22 +10402,20 @@ void Mob::SetBuffDuration(int spell_id, int duration) { int buff_count = GetMaxTotalSlots(); for (int slot = 0; slot < buff_count; slot++) { - if (!adjust_all_buffs) { if (IsValidSpell(buffs[slot].spellid) && buffs[slot].spellid == spell_id) { - SpellOnTarget(buffs[slot].spellid, this, 0, false, 0, false, -1, duration, true); + SpellOnTarget(buffs[slot].spellid, this, 0, false, 0, false, level, duration, true); return; } - } - else { + } else { if (IsValidSpell(buffs[slot].spellid)) { - SpellOnTarget(buffs[slot].spellid, this, 0, false, 0, false, -1, duration, true); + SpellOnTarget(buffs[slot].spellid, this, 0, false, 0, false, level, duration, true); } } } } -void Mob::ApplySpellBuff(int spell_id, int duration) +void Mob::ApplySpellBuff(int spell_id, int duration, int level) { /* Used for quest command to apply a new buff with custom duration. @@ -10435,7 +10433,7 @@ void Mob::ApplySpellBuff(int spell_id, int duration) duration = PERMANENT_BUFF_DURATION; } - SpellOnTarget(spell_id, this, 0, false, 0, false, -1, duration); + SpellOnTarget(spell_id, this, 0, false, 0, false, level, duration); } int Mob::GetBuffStatValueBySpell(int32 spell_id, const char* stat_identifier)