LUA Functions Request

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

Moderator: Team Members

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

LUA Functions Request

Post by Scatman » Wed Aug 27, 2008 9:26 pm

Hey LE,
I don't know if you have already thought about it or started it, but whenever you get a chance do you think a few more LUA functions could be implemented? This is mostly just for me so I don't forget, no rush in getting these done because I know there are more important things to worry about :)
-summoning items
-spawning spawns
Those are the two big ones I can think of right now. Thanks!

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Post by Zcoretri » Wed Aug 27, 2008 10:29 pm

If I'm not mistaken you can do those already
To summon an item into your inventory use:
/summonitem [item ID]
To create a spawn use:
/spawn create [spawn type] [race type] [class type] [level] [name] (difficulty) (size)
Then you can save it to the database by using
/spawn add [spawn group ID] [spawn group name] (percentage)
parameters in brackets [] are required and the ones in parenthesis are optional.

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

Post by Scatman » Wed Aug 27, 2008 10:43 pm

Yah I know you can do that, but you can't call those commands from a LUA script unless I'm mistaken (and I usually am!) hehe.

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 » Thu Aug 28, 2008 6:29 am

Scatman wrote:do you think a few more LUA functions could be implemented?
~points~
;)
While we're requesting LUAs... I am not sure if there is "stun" or "knockback" support in the code yet, but we'll need the ability to stun or knockback/down our targets in LUA unless this is going to be core functionality of the particular spell effect in the server...
I think we can fake "DoT" right now... using damageType, damageTotal, and duration (?) to loop and eat away at our foe. Ya think?
Edit: One more thing (hehe). We have an AddQuestStepLocation() LUA function, so when we come to an area we can receive a response from the server that we have "discovered" the area. However (and I haven't tried this yet myself) does this have to be an active "quest" for this to actually work? If so, do we have to make a hella gigantic quest script with every discovery location in the entire game and attach it to each player when they are created? Or how do you see this working? Maybe I should try it first. ;)
Edit2: Actually, according to this function description:
AddQuestStepLocation(Quest, Step ID, Description, X, Y, Z, MaxVariation, TaskGroupText)
NOTE: MaxVariation is the distance the player can be from the location and still get credit
I think a quest has to be assigned, and steps in order (yes/no?) which would render this function for Discovery unusable. Maybe some tweaking is in order, or as usual, I do not fully understand the script params.

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

Post by Scatman » Thu Aug 28, 2008 9:13 am

I don't think that function is used for "you have discovered blah blah, you gain experience for discovering a new area!". I believe that function is for an actual quest step like "Scat needs me to go find the spider caves, maybe I should check the northeast corner of the queen's colony." Then you use that function to describe the x,y,z with a radius of where the player with the quest can receive the update and send the appropriate quest update message like, "I have found the spider caves like Scat has requested."

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:

Post by John Adams » Thu Aug 28, 2008 12:01 pm

I know what AddQuestLocationStep() is used for in that respect, silly man. :)
I am asking if the intent was to also use it for discoveries - and I do not think it'll work as it is currently designed.

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

Post by Scatman » Thu Aug 28, 2008 12:44 pm

That's what I get for not reading your first edit haha.

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:

Post by John Adams » Thu Aug 28, 2008 3:48 pm

I am notorious for my stealth edits ;)

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Thu Aug 28, 2008 4:58 pm

John Adams wrote:I know what AddQuestLocationStep() is used for in that respect, silly man. :)
I am asking if the intent was to also use it for discoveries - and I do not think it'll work as it is currently designed.
Nope, it wasnt designed for location discoveries, only quests.

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:

Post by John Adams » Thu Aug 28, 2008 6:24 pm

Well then, there ya go. I knew I was right about something. Just didn't know what.

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Post by Zcoretri » Thu Aug 28, 2008 11:01 pm

Scatman wrote:Yah I know you can do that, but you can't call those commands from a LUA script unless I'm mistaken (and I usually am!) hehe.
Ah shit, helps to comprehend what you read, lol, went right by the part about lua scripting. Been going to a skills assesment class the past 2 weeks that goes from 7am to 3pm then working at my part time job from 5pm to 10pm, so I have been a little teary eyed the past few days :?
Thats why I haven't been as active lately. I am trying to land a job at Boeing working on the new 787.

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

Post by Scatman » Thu Aug 28, 2008 11:09 pm

Oh nice :). I work at the FAA as a 2nd level support/engineer (last year in college also) so I hear all about that kind of stuff.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri Aug 29, 2008 5:05 am

Good luck on the job, even if it means that you wont be available as much for emu work. Real life should always come first. It seems that we are all involved with planes in one way or another. I work for the Air Force and write software used to keep them safe. :)

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri Aug 29, 2008 1:29 pm

I added the following LUA commands:
SpellHeal(Target, Caster, amount) - not functional yet, but here as a heads up
SummonItem(Player, item_id)
Spawn(Spawn, spawn_id, boolean) - the first Spawn parameter is only needed to get a reference to the current Zone. The last parameter is used to determine if the spawn is a private spawn (noone but those allowed are able to even see it)
AddSpawnAccess(Spawn, Spawn) - This is the command that gives players access to see and interact with private spawns. The first parameter is the spawn you wish to add access to and the second one is the player which needs the access.

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

Post by Scatman » Fri Aug 29, 2008 1:33 pm

Wow cool thanks LE, that was quick. Regarding the Spawn command, say I was spawning a spawn with id of 5000. What would I put for the "Spawn" param? The NPC param?

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests