Page 1 of 9
LUA Functions Request
Posted: Wed Aug 27, 2008 9:26 pm
by Scatman
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!
Posted: Wed Aug 27, 2008 10:29 pm
by Zcoretri
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.
Posted: Wed Aug 27, 2008 10:43 pm
by Scatman
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.
Re: LUA Functions Request
Posted: Thu Aug 28, 2008 6:29 am
by John Adams
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.
Posted: Thu Aug 28, 2008 9:13 am
by Scatman
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."
Posted: Thu Aug 28, 2008 12:01 pm
by John Adams
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.
Posted: Thu Aug 28, 2008 12:44 pm
by Scatman
That's what I get for not reading your first edit haha.
Posted: Thu Aug 28, 2008 3:48 pm
by John Adams
I am notorious for my stealth edits

Posted: Thu Aug 28, 2008 4:58 pm
by LethalEncounter
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.
Posted: Thu Aug 28, 2008 6:24 pm
by John Adams
Well then, there ya go. I knew I was right about something. Just didn't know what.
Posted: Thu Aug 28, 2008 11:01 pm
by Zcoretri
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.
Posted: Thu Aug 28, 2008 11:09 pm
by Scatman
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.
Posted: Fri Aug 29, 2008 5:05 am
by LethalEncounter
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.

Posted: Fri Aug 29, 2008 1:29 pm
by LethalEncounter
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.
Posted: Fri Aug 29, 2008 1:33 pm
by Scatman
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?