Figured I would bring this up again with the recent work with lua AI
alfa wrote:
GetAttackersList --> return an iterator of all player in group / raid (should be optionnal) of attackers
GetHateList() will get an array of every one who has hate with the given spawn
alfa wrote:
GetNPCGroupList --> return an iterator of all npcs in group / raid of current npc
GetGroup() will get an array of every one in the group with the given spawn, will work with both a player and a NPC
alfa wrote:
GetSpellsList --> return an iterator of all Spell player have
GetBuffsList --> return an iterator of all active buff player have
I assume this is for spells currently active on the player/npc if so then
HasSpellEffect() should work for both
alfa wrote:
GetEquipedItems --> return an iterator of equiped items
GetEquippedItemsBySlot() and
GetEquippedItemByID() will get equipped items by id or by slot
alfa wrote:
Possibility to have GetHP / GetPrower functions return in % (of max life)
Have to agree with john (don't faint john) on you can just add a line of code at the top of the function
Code: Select all
local health_pct = GetHP(Spawn) / GetMaxHP(Spawn)
alfa wrote:
Need possibility to add handler
Using healthchanged and temp variables you can get this,
SetTempVariable() and
GetTempVariable()
Code: Select all
function healthchanged(NPC, Spawn)
local health_pct = (GetHP(Spawn) / GetMaxHP(Spawn)) * 100 -- added " * 100" so .5 = 50
if health_pct <= 50 then
local result = GetTempVariable(NPC, "50%Event")
-- check to see if the even has happened yet
if result ~= "True" then
-- code for 50% event here
-- Set the temp variable so this code won't be triggered again
SetTempVariable(NPC, "50%Event", "True")
end
end
end
You should also clear the variables if the npc wins so the next time the npc goes in combat the events will trigger again
Code: Select all
function CombatReset(NPC)
-- Clear the event variables
SetTempVariable(NPC, "50%Event", nil)
end
As for your options on the lists you can check in lua
alfa wrote:
- list by archetype
GetArchetypeName()
alfa wrote:
- list by class
GetClassName()
alfa wrote:
- only who are alive
alfa wrote:
- only who are in aggro list (can be used to have only ppl alive)
GetHateList()
alfa wrote:
- only who ahve/don't have an item or equiped item
GetItemByID()
GetEquippedItemBySlot()
GetEquippedItemByID()
alfa wrote:
- only who have more or less than a percentage of health
Just check the health percent
Code: Select all
local health_pct = (GetHP(Spawn) / GetMaxHP(Spawn)) * 100 -- added " * 100" so .5 = 50
alfa wrote:
- only who have more or less than a percentage of power
Same as above just with the power lua functions
alfa wrote:
- only who have a specific buff active
HasSpellEffect()