[Quest API] Add Area-Based Quest Methods to Perl/Lua (#4447)

* [Quest API] Add Area-Based Quest Methods to Perl/Lua

* Convert some to mob

* Fix
This commit is contained in:
Alex King
2024-08-26 21:29:07 -04:00
committed by GitHub
parent 080865faa2
commit 40738b29e3
13 changed files with 492 additions and 135 deletions
+4 -4
View File
@@ -886,13 +886,13 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp
*/
if (!ignore_on_casting) {
if (spells[spell_id].pcnpc_only_flag && spells[spell_id].target_type != ST_AETargetHateList && spells[spell_id].target_type != ST_HateList) {
if (spells[spell_id].pcnpc_only_flag == 1 && !spell_target->IsClient() && !spell_target->IsMerc() && !spell_target->IsBot()) {
if (spells[spell_id].pcnpc_only_flag == PCNPCOnlyFlagType::PC && !spell_target->IsClient() && !spell_target->IsMerc() && !spell_target->IsBot()) {
if (check_on_casting) {
Message(Chat::SpellFailure, "This spell only works on other PCs");
}
return false;
}
else if (spells[spell_id].pcnpc_only_flag == 2 && (spell_target->IsClient() || spell_target->IsMerc() || spell_target->IsBot())) {
else if (spells[spell_id].pcnpc_only_flag == PCNPCOnlyFlagType::NPC && (spell_target->IsClient() || spell_target->IsMerc() || spell_target->IsBot())) {
if (check_on_casting) {
Message(Chat::SpellFailure, "This spell only works on NPCs.");
}
@@ -3947,12 +3947,12 @@ bool Mob::SpellOnTarget(
spells[spell_id].target_type != ST_HateList
) {
if (
spells[spell_id].pcnpc_only_flag == 1 &&
spells[spell_id].pcnpc_only_flag == PCNPCOnlyFlagType::PC &&
!spelltar->IsOfClientBotMerc()
) {
return false;
} else if (
spells[spell_id].pcnpc_only_flag == 2 &&
spells[spell_id].pcnpc_only_flag == PCNPCOnlyFlagType::NPC &&
(
spelltar->IsOfClientBotMerc()
)