Spawn Group ENUM request

Discussions on development of both the EQ2Emulator LUA Script Engine and Script specifications

Moderator: Team Members

Post Reply
User avatar
alfa
Team Member
Posts: 550
Joined: Fri Jul 27, 2007 6:24 pm
Location: France
Contact:

Spawn Group ENUM request

Post by alfa » Sat Feb 25, 2012 6:03 pm

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.
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: LUA Functions Request

Post by Scatman » Sat Feb 25, 2012 10:09 pm

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.

User avatar
alfa
Team Member
Posts: 550
Joined: Fri Jul 27, 2007 6:24 pm
Location: France
Contact:

Re: LUA Functions Request

Post by alfa » Sun Feb 26, 2012 5:23 am

Scat, just tell how I can proced to get / return iterator of player group and I will try
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: LUA Functions Request

Post by John Adams » Sun Feb 26, 2012 10:28 am

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?

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: LUA Functions Request

Post by Scatman » Sun Feb 26, 2012 3:02 pm

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?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: LUA Functions Request

Post by John Adams » Sun Feb 26, 2012 3:50 pm

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?

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: LUA Functions Request

Post by Scatman » Sun Feb 26, 2012 10:19 pm

Yeah exactly. We can even make it more intelligent than 3 settings. But yeah along those lines fo sho

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests