PDA

View Full Version : Corpses and Junk


KLS
10-13-2006, 03:19 PM
Inspiried by http://www.eqemulator.net/forums/showthread.php?t=21596

Changes some stuff with corpses and a few other changes:
-Corpses will not decay right away if they're empty, they need to be looted first.
-Until level 6 you take no experience penalty, and leave a naked corpse
-Corpses should appear for people who were around to witness their creation (as it is, right now you need to zone to be able to see a created player corpse?)
-Added a variable (perhaps set this to be a rule rather?) 'leavenakedcorpse' 0 for normal corpse creation, 1 will make all corpses naked.
-Pretty sure fixed the looting stacks of stuff off corpses only gives you 1 item regardless of stack size
-Pretty sure fixed the group leader not being able to talk in group after creation until he zones.
-Changed how consider and consider corpse is handled a bit, consider corpse should be more informative and consider should now reflect if you're on a targets hate list and not already kos(ex. dubious mob will threateningly you if you attack it)
-Changed con level code to be more accurate, tested all the way up to level 70
-Increased the range for /pet attack, it was at a measly 10 range previously, I bumped it up to 100... 10 is pretty dang small.

Diff:
http://hmproject.org/files/corpsediff.txt

Tell me if there are any issues, I didn't see any but never know.

John Adams
10-13-2006, 05:00 PM
Very nice. I will check this out, as it saves me a ton of work (learning, mostly). TIA!

There is a variable in "variables" table called "leavecorpses" that could be utilized, but I like the idea of it being a rule instead. Might as well stop adding to the database/restart-the-world variables and get to using this rule system. I think another good thing about the rules system is it appears you can tie it to a zone, or an account, or the whole world, and have different sets. At least that's what it appears to do.

KLS
10-14-2006, 11:30 AM
Don't feel like making a new post for one line of code change so... while testing this all out I noticed my faction wasn't raising or lowering on mobs.

in Client::SetFactionLevel() there is:

if(tmpValue >= MAX_FACTION)
{
t = MAX_FACTION - mod;
if(current_value == t) {
//do nothing, it is already maxed out
} else if(!(database.SetCharacterFactionLevel(char_id, faction_id[i], t, factionvalues)))
{
return;
}
}
else if(tmpValue <= MIN_FACTION)
{
t = MIN_FACTION - mod;
if(current_value == t) {
//do nothing, it is already maxed out
} else if(!(database.SetCharacterFactionLevel(char_id, faction_id[i], t, factionvalues)))
{
return;
}
}
else
{
if(!(database.SetCharacterFactionLevel(char_id, faction_id[i], current_value, factionvalues)))
{
return;
}
}


the issue is down there at the bottom

if(!(database.SetCharacterFactionLevel(char_id, faction_id[i], current_value, factionvalues)))


You're supposed to be setting the new faction value but you're setting it to the current_value?
should be something like

if(!(database.SetCharacterFactionLevel(char_id, faction_id[i], current_value+npc_value[i], factionvalues)))

fathernitwit
10-15-2006, 10:32 AM
hey,nice work. here are my quickly scribed comments as I was merging it in:


Please ignore whitespace when making your diffs.

When adjusting hard coded constants in the code, like exp loss level or pet range, please replace the constants with the rule system instead (placing your value as the default), so people can tune it as they see fit.

as for your pet thing, the DistNoZ returns an absolute distance, not a squared, so you increased the range to 10000. I changed this to 150.

what is this about? did you mean to send out app3 instead of app2 2 lines down?

+ EQApplicationPacket app3;
+ CreateSpawnPacket(&app3, new_corpse);


as for:

+ AddCash(0,0,0,0);
+ //Add no money because otherwise the corpse tries to use
+ //Uninited Vars and you'll get random amounts of money from the naked corpse

its better to fix the problem (init them to 0 in constructor) than to do this.

KLS
10-15-2006, 10:44 AM
I'm not sure on the createspawnpacket thing, all I know is it works and works well. I actually had written that part of it a while back so I don't remember the logic offhand when I wrote it.

I'm sorry about the diffs, I'm still new at making them, I've never really coded for much more than myself you see. And yeah I really should have fixed the problem and put the system in rules(had been considering it, see above).

Will take a look at the corpse packet thing and try to see wtf I was doing.

KLS
10-15-2006, 10:58 AM
Looking at it I'm pretty sure it's just an artifact of something I tried to do in the earlier code that didn't get removed when I put it all together and I didn't catch it, sorry.