PDA

View Full Version : Kudos, and a question


Dhrystone
02-18-2013, 10:57 AM
Hi everyone...

First a salute to everyone involved in this project. I just discovered it a few days ago and it's awesome. I'm a commercial developer and I know how much work, time, effort and tedium goes into the development process and I'm awed by the passion that leads you to do this for free.

I'm also an EQ player from way back in 1999 although I haven't touched the game since about 2003. Someone pointed me to EQEMU and damn I'm impressed.

My own contribution is to build a server with something I always wanted to be able to try: permanent death. So I'm working on the 'Survivor' server, right now testing it to be sure the game functions as well as possible with the PEQ database.

So, to implement permadeath I'm thinking I'd like to cast a permanent root on a player (that's selected the option it will be optional) if they die past level 10. That way they still exist but can't move so can't play.

My question: is there any way outside of a code change to rig the database to cast a spell on anyone who dies, maybe based on a qglobal? I'd rather do this without code changes if possible but I'll make them if necessary.

Any comments ideas and suggestions are welcome...

Thanks again all of you,
Dhry

Drajor
02-18-2013, 11:13 AM
Hello and welcome Dhry :)

I saw your server in the list today and wondered who the dev was. To answer your question: Yes it would be possible to set a qglobal when a character dies. I would probably use EVENT_SLAY on NPCs and set the qglobal when that is triggered. Then use EVENT_ENTERZONE for clients and check the qglobal in that.

That is a little off the cuff though. There are some extremely talented guys who know the scripting system much better than me. Maybe one of them will share a better way!

Dhrystone
02-18-2013, 11:36 AM
Thank you, thank you !

I'm a total newbie. I've just figured out today how to get the Avatar of Mortality to spawn in PoK and how to get her to say some text.

Now the plan, subject to change as I learn and get suggestions of course, is to have her be the agent to put the player in permadeath mode through a quest dialog that would set a qglobal indicating permadeath mode for the player character.

Then using EVENT_SLAY or some mechanism, if a player with that qglobal set to on dies cast some nasty disabling permanent spell on them (spell to be named "Death" of course.)

I want the character to still exist just be disabled by being rendered unable to move or cast. Alternatively they could be ported to some purgatory zone and rendered unable to cast. But the point is to make death reversible by GM action so that in case they died from some bug they could be restored. Also, the ability of the dead to will their gear to someone else.

Players without that permadeath qglobal set would play like an normal PEQ-based server.

I would probably make the effect reversible by talking to the Avatar again -- but only once.

The ultimate idea is to have a leaderboard somewhere (in game?) so that those players who get the highest in level without dying can be recognized for their accomplishment.

Dhry

Zaela_S
02-18-2013, 03:04 PM
I would probably use EVENT_SLAY on NPCs and set the qglobal when that is triggered. Then use EVENT_ENTERZONE for clients and check the qglobal in that.

Why there is no EVENT_DEATH for clients by default is a mystery to me.

Dhrystone
02-18-2013, 04:09 PM
Is there some global perl script like player.pl but that applies to all zones?

I could probably implement an EVENT_DEATH in the code and maybe get an official dev to get it in the standard.

Dhry

ghanja
02-18-2013, 04:45 PM
global_player.pl

then a player.pl in each zone (if so desired)

Zaela_S
02-18-2013, 04:53 PM
I could probably implement an EVENT_DEATH in the code and maybe get an official dev to get it in the standard.

I'm working on an implementation of the quest scripting system in Lua with an eye to fix all the things that seem like oversights or that just aren't designed as well as they should be. And to get away from some of Perl's trickier syntax.

Whether that will be accepted is a whole other matter, though...

c0ncrete
02-18-2013, 05:31 PM
i don't really think the issue is Perl's syntax, but rather the hell that is XS. it's sort of off-putting. i've added custom events before, and that isn't too bad. but some things like adding new objects and exporting (or importing.... yuck) associative arrays aren't quite as straightforward.

Akkadius
02-18-2013, 08:38 PM
The XS integration with C++ isn't beautiful and hooking into events may not be as easily integrated as LUA but we have most functionality that a person would really care for in Perl.

Zaela_S
02-18-2013, 09:53 PM
I don't doubt it.

On the other hand, everything you could really need out of a central repository you can get from SVN. And now we expect everyone to switch to, and learn to use, Git. And that is very much a good thing.

Dhrystone
02-19-2013, 01:56 PM
Somewhat back on topic...with more questions.

Where would I put an EVENT_SLAY sub to intercept the event globally?

Doesn't appear work in global_player.pl in the templates folder, and that's the only global_player.pl I found and it's the one being used because I can change the mysterious voice text and it changes globally.

I found a default.pl file in the plugins folder with an EVENT_SLAY sub in it and thought I'd hit pay dirt, but putting a quest::say in that sub didn't result in the text being said when I die.

The only way I've got anything to work so far is to put the EVENT_SLAY in the .pl for a speciflc NPC and let that NPC kill me.

What am I missing? OR is this even possible without changing the code.

I realize EVENT_SLAY only applies to kills by NPCs and not the other ways players can die but that's actually okay.

Dhry

Mariomario
02-19-2013, 02:12 PM
When using the default.pl it only effects NPCs who don't already have a script, so perhaps when you tried it you were killed by an NPC who already had a script of his own, therefore the EVENT_SLAY did not take precedence from the default.pl you had it contained in.

How the script chain of command works:

specific npc.pl then,

folder default.pl then,

global default.pl.

So if you have a default.pl already in a folder for a zone, a global default.pl wouldnt affect anything in that zone, and likewise for an NPC's specific .pl script. Anything you have in the default.pl for the zone wouldnt affect anything for that specific NPC.

I hope this is understandable and you figure out what you're looking for.

Dhrystone
02-19-2013, 03:21 PM
Thanks. Yes, very clear.

I solved the problem by adding a test of $client->GetCorpseCount > 0 to the EVENT_ENTERZONE event in global_player.pl

This works because after death the first thing that happens is a return to bind point. The ENTERZONE is triggered upon landing on your bind point.

The code in global_player.pl then casts a spell on the player to silence them for 5 days so they can't cast, and moves them to the tutoriala zone. Where there is no exit. It also sets another qglobal. If somehow they get out (maybe by waiting out the 5-day timer) then upon entry into any other zone the same event will trigger putting them right back into...purgatory!

Now, all the dead players will be able to re-enact NO EXIT in the tutoriala zone :)

The Survivor Server is open for beta testing of the perma-death (actually perma-purgatory) option now.

Turning on the option is done by speaking to the Avatar of Mortality in PoK.

Thank you all for the help and guidance here.

Dhry