|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics. Do not post support topics here. |
11-05-2016, 12:38 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,594
|
|
Perl/Lua Development.
Hello everyone, I'm making this post as a way of seeing what people would like to see in Perl/Lua, by this I mean things like updating the zone header or world-wide marquee messages. Just miscellaneous things that would be nice for server owners to have at their disposal or things that would be highly beneficial. It's hard to know what to do without people telling me what they would like to see. If you have any questions, feel free to ask. I will do my best to monitor this thread and reply as soon as possible. Thanks!
|
|
|
|
12-09-2016, 10:49 PM
|
Fire Beetle
|
|
Join Date: Nov 2016
Posts: 2
|
|
Hi there. I'm pretty new to this, used a combo of Akka's self-installer and some manual work to get a currently private server and login running that seems to be doing pretty well so far, and worked on some custom scripts in both Perl and Lua. Here's what I've run into as far as what I'd like to see as a newbie. Keep in mind I might have just missed how to do some of this stuff as I'm fairly new, but I did search for all of it:
Lua: - Built in DB functionality, or an easy way to integrate LuaRocks or something to install other modules. I spent a while trying to get a MySQL module working, but eventually gave up in frustration and ported my global_player file to Perl
- More documentation on how to use packets/opcodes would be fantastic!
- Also, the available material I could find on opcodes is either outdated/incomplete wrt RoF2 client, or I have a weird version of the client. The build reports as "May 10 2013 23:30:08" in dbg.txt. I feel like I could do a whole lot more with quest scripting if there was a reliable way to use opcodes and packets, but currently it's sort of trial and error to get anything to work. The comments in eq_packet_structs.h are helpful, but many of the structs don't have any info about them other than var types.
- Continuing with packets: How do people work to discover and test with these nowadays? The older tools don't seem to work with my client.
Perl:
Both: - A Sit() command that works for clients, seriously. I've tried the animation functions, but they don't behave as expected on clients it seems. I can sometimes get them to sit and stay seated, but oddly can't figure out why it only works seemingly randomly. The other times, the majority, it does the sit animation, then the client immediately stands back up. I tried incorporating SetAppearance as well, but no dice. I also tried investigating using packets to do this, but couldn't wrap my head around the format of the struct to send and if that was all that was needed.
- Plugins to handle spell casting in a more complete yet simple fashion to how simple spells work naturally in-game, in a way that takes into account animation, particle effects, sound, etc. in one package, something like $client/e.self:Cast(spell_id, target, animation, particles, sound) would be a dream. I'm really weak messing with spell stuff so far, so I might just need to find a more efficient way to do it.
- Signals that can send something more complex than an integer, maybe even just some bitmask functions or something included would help. Right now I'm messing with stuff like using each digit of an integer in the signal to send multiple pieces of info.
- IsMemmed(spell_id) to avoid pulling from the database to get that info.
- FollowPlayer(client_id) as in /follow for group members
|
|
|
|
|
|
|
12-11-2016, 03:58 PM
|
Fire Beetle
|
|
Join Date: Jun 2012
Posts: 5
|
|
Code:
sub EVENT_SPAWN
{
$npc->SetAppearance(1);
my $x = $npc->GetX();
my $y = $npc->GetY();
quest::set_proximity($x - 10, $x + 10, $y - 10, $y + 10);
$x = undef;
$y = undef;
}
sub EVENT_ENTER
{
my $x = $npc->GetX();
my $y = $npc->GetY();
$npc->DoAnim(64);
quest::set_proximity($x - 75, $x + 75, $y - 75, $y + 75);
quest::follow($userid);
$x = undef;
$y = undef;
}
sub EVENT_EXIT
{
my $x = $npc->GetX();
my $y = $npc->GetY();
quest::set_proximity($x - 10, $x + 10, $y - 10, $y + 10);
quest::sfollow(); # if we weren't expecting to stop following here we would still use quest::stop(); before sitting.
quest::doanim(26);
quest::settimer("sittime", 5);
$x = undef;
$y = undef;
}
sub EVENT_TIMER
{
if ($timer eq "sittime")
{
quest::stoptimer("sittime");
$npc->SetAppearance(1);
}
}
In Perl this seems to make the npc it's written for sit upon spawning, follow anyone that enters it's proximity, and sit back down and appear to remain seated indefinitely when someone exits. If you've altered the SendAppearance function or any related structs or functions you might need to restore them, I remember trying to alter them also to get this to work, but the stock install seems to work with this script.
|
|
|
|
12-11-2016, 04:15 PM
|
Fire Beetle
|
|
Join Date: Nov 2016
Posts: 2
|
|
Thanks Loxo, but I'm trying to get sit and follow to work for $client rather than $npc. I'm not sure if there's some restriction there, but follow doesn't seem to work at all for clients, and sit is where I'm having it work only rarely for clients under some conditions I couldn't work out.
|
|
|
|
12-11-2016, 05:13 PM
|
Demi-God
|
|
Join Date: Apr 2008
Location: MA
Posts: 1,164
|
|
Quote:
Originally Posted by rawfullemayo
Built in DB functionality, or an easy way to integrate LuaRocks or something to install other modules. I spent a while trying to get a MySQL module working, but eventually gave up in frustration and ported my global_player file to Perl
|
I added support to make using LuaRocks easier. You just have to point your luarocks tree or w/e they call it to the lua_modules folder and make sure the server and luarocks are using the same version of lua.
Quote:
Originally Posted by rawfullemayo
Continuing with packets: How do people work to discover and test with these nowadays? The older tools don't seem to work with my client.
|
I generally use IDA to analyze the client and then will usually prototype in lua (if it isn't easier to do in server code.) I will also sometimes do packet captures on live and try to find similar functions in older client and see how it has changed, again with IDA.
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 07:45 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|