Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 10-13-2006, 03:19 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default Corpses and Junk

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.
Reply With Quote
  #2  
Old 10-13-2006, 05:00 PM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

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.
Reply With Quote
  #3  
Old 10-14-2006, 11:30 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

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:
Code:
			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
Code:
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
Code:
if(!(database.SetCharacterFactionLevel(char_id, faction_id[i], current_value+npc_value[i], factionvalues)))
Reply With Quote
  #4  
Old 10-15-2006, 10:32 AM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

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?
Code:
+                       EQApplicationPacket app3;
+                       CreateSpawnPacket(&app3, new_corpse);
as for:
Code:
+               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.
Reply With Quote
  #5  
Old 10-15-2006, 10:44 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

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.
Reply With Quote
  #6  
Old 10-15-2006, 10:58 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:18 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3