Page 1 of 1

Spawn Group ENUM request

Posted: Sat Feb 25, 2012 6:03 pm
by alfa
Requesting 2 functions pls and I could try to do some things with it ^^

EQ2Emu_lua_GetPlayerGroupEnum(player) -- That return an enum of players / pets in group
EQ2Emu_lua_GetSpawnGroupEnum(spawn) -- That return an enum of spawns in spawn group

It could be really usefull for some AI script, like a gnoll healer in Antonica that check his group and if a member under 25 % he cast spell on it (*don't live value for the 25%), or a gnoll figther that check all players in attacker group, and if one have other target he cast taunt on player. Or you can use it for set some zone wide detrimental (remember Voxx in perma at good times but was not attacker group AE... Zone Wide powwa)

I think with this two functions, we can get spawn more "real" (and off like) in fight.

Re: LUA Functions Request

Posted: Sat Feb 25, 2012 10:09 pm
by Scatman
Well I think it'd be better if we built NPC AI healing into the server core itself. However, these functions can still be useful. Anyone want to take on this task or want me to do it? If done, I would remove the "Enum" part of the function as I believe it looks a little nicer.

Re: LUA Functions Request

Posted: Sun Feb 26, 2012 5:23 am
by alfa
Scat, just tell how I can proced to get / return iterator of player group and I will try

Re: LUA Functions Request

Posted: Sun Feb 26, 2012 10:28 am
by John Adams
Don't we already have LUA functions to handle what happens when someone's health changes? There's a bunch that are not in lua* files, but still LUA scripted. Not sure why they are sepErated...

Remember these?
function spawn(NPC)
--Syntax is NPC, x, y, z, speed, delay (in seconds)
--MovementLoopAddLocation(NPC, x, y, z, 2, 30)
end

function respawn(NPC)
Say(NPC, "I am respawning!!")
end

function attacked(NPC, Spawn)
Say(NPC, "Attack me will you?!?!")
end

function targeted(NPC, Spawn)
FaceTarget(NPC, Spawn)
Say(NPC, "You feeling lucky, punk?!? Well do you..?")
end

function hailed(NPC, Spawn)
FaceTarget(NPC, Spawn)
Emote(NPC, "glares at you.")
Say(NPC, "Yes, Hail to you as well.")
end

function death(NPC, Spawn)
Say(NPC, "Alas, I am dead. :(")
end

function killed(NPC, Spawn)
Say(NPC, "Haha, I killed j00. I am leet!")
end

function aggro(NPC, Spawn)
Say(NPC, "You have ruined your own lands. You shall not ruin mine!!")
end

function healthchanged(NPC)
Say(NPC, "Oh no, I am getting low on health.")
end
A script can be set to call on another entity and trigger an action, no? Ie., my health is low, so tell spawn_id 123456 to heal my azz?

Re: LUA Functions Request

Posted: Sun Feb 26, 2012 3:02 pm
by Scatman
Well i think he wanted a function to return an array of group members. That wY you could do specifoc thongs with the group. But maybe that should still be dictated by tge server?

Re: LUA Functions Request

Posted: Sun Feb 26, 2012 3:50 pm
by John Adams
Hmm, I think I get what you're saying. We should probably not hard-code that unless we govern it with parameters (spawn records or whatever), make the AI control how it reacts. There may be cases where allowing the Server to decide what NPC heals whom might not be desired, for example. I think our NPC AI already has enums for whether or not it is offensive, defensive or balanced.

Is that what you're thinking?

Re: LUA Functions Request

Posted: Sun Feb 26, 2012 10:19 pm
by Scatman
Yeah exactly. We can even make it more intelligent than 3 settings. But yeah along those lines fo sho