mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-29 16:58:02 +00:00
[Quest API] Add LDoN Methods to Perl/Lua (#2799)
# Perl - Add `$npc->GetLDoNLockedSkill()`. - Add `$npc->GetLDoNTrapType()`. - Add `$npc->GetLDoNTrapSpellID()`. - Add `$npc->IsLDoNLocked()`. - Add `$npc->IsLDoNTrapped()`. - Add `$npc->IsLDoNTrapDetected()`. - Add `$npc->SetLDoNLocked(is_locked)`. - Add `$npc->SetLDoNLockedSkill(skill_value)`. - Add `$npc->SetLDoNTrapped(is_trapped)`. - Add `$npc->SetLDoNTrapDetected(is_detected)`. - Add `$npc->SetLDoNTrapSpellID(spell_id)`. - Add `$npc->SetLDoNTrapType(trap_type)`. # Lua - Add `npc:GetLDoNLockedSkill()`. - Add `npc:GetLDoNTrapType()`. - Add `npc:GetLDoNTrapSpellID()`. - Add `npc:IsLDoNLocked()`. - Add `npc:IsLDoNTrapped()`. - Add `npc:IsLDoNTrapDetected()`. - Add `npc:SetLDoNLocked(is_locked)`. - Add `npc:SetLDoNLockedSkill(skill_value)`. - Add `npc:SetLDoNTrapped(is_trapped)`. - Add `npc:SetLDoNTrapDetected(is_detected)`. - Add `npc:SetLDoNTrapSpellID(spell_id)`. - Add `npc:SetLDoNTrapType(trap_type)`. # Notes - Adds these methods to allow LDoN traps to be set by a script.
This commit is contained in:
+21
-22
@@ -371,16 +371,16 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
|
||||
}
|
||||
}
|
||||
|
||||
ldon_trapped = false;
|
||||
ldon_trap_type = 0;
|
||||
ldon_spell_id = 0;
|
||||
ldon_locked = false;
|
||||
ldon_locked_skill = 0;
|
||||
ldon_trap_detected = false;
|
||||
SetLDoNTrapped(false);
|
||||
SetLDoNTrapType(0);
|
||||
SetLDoNTrapSpellID(0);
|
||||
SetLDoNLocked(false);
|
||||
SetLDoNLockedSkill(0);
|
||||
SetLDoNTrapDetected(false);
|
||||
|
||||
if (npc_type_data->trap_template > 0) {
|
||||
std::map<uint32, std::list<LDoNTrapTemplate *> >::iterator trap_ent_iter;
|
||||
std::list<LDoNTrapTemplate *> trap_list;
|
||||
std::list<LDoNTrapTemplate *> trap_list;
|
||||
|
||||
trap_ent_iter = zone->ldon_trap_entry_list.find(npc_type_data->trap_template);
|
||||
if (trap_ent_iter != zone->ldon_trap_entry_list.end()) {
|
||||
@@ -390,26 +390,25 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
|
||||
std::advance(trap_list_iter, zone->random.Int(0, trap_list.size() - 1));
|
||||
LDoNTrapTemplate *trap_template = (*trap_list_iter);
|
||||
if (trap_template) {
|
||||
if ((uint8) trap_template->spell_id > 0) {
|
||||
ldon_trapped = true;
|
||||
ldon_spell_id = trap_template->spell_id;
|
||||
}
|
||||
else {
|
||||
ldon_trapped = false;
|
||||
ldon_spell_id = 0;
|
||||
if (trap_template->spell_id > 0) {
|
||||
SetLDoNTrapped(true);
|
||||
SetLDoNTrapSpellID(trap_template->spell_id);
|
||||
} else {
|
||||
SetLDoNTrapped(false);
|
||||
SetLDoNTrapSpellID(0);
|
||||
}
|
||||
|
||||
ldon_trap_type = (uint8) trap_template->type;
|
||||
SetLDoNTrapType(static_cast<uint8>(trap_template->type));
|
||||
|
||||
if (trap_template->locked > 0) {
|
||||
ldon_locked = true;
|
||||
ldon_locked_skill = trap_template->skill;
|
||||
}
|
||||
else {
|
||||
ldon_locked = false;
|
||||
ldon_locked_skill = 0;
|
||||
SetLDoNLocked(true);
|
||||
SetLDoNLockedSkill(trap_template->skill);
|
||||
} else {
|
||||
SetLDoNLocked(false);
|
||||
SetLDoNLockedSkill(0);
|
||||
}
|
||||
|
||||
ldon_trap_detected = 0;
|
||||
SetLDoNTrapDetected(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user