EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Bug Reports (https://www.eqemulator.org/forums/forumdisplay.php?f=591)
-   -   [Bugs] Corpses issues with leavecorpses set to 1 (https://www.eqemulator.org/forums/showthread.php?t=19239)

Dakaar 09-20-2005 06:08 AM

I think i remember seeing something in the code specifically about that where it is a seperate case, buuut i cant recall right now.


Actually while my fix worked, it apparently wasnt the root of the problem, FNW put up a new fix on CVS after I told him about what I did, im testing this out now as well

Dakaar 09-20-2005 08:00 AM

Okay, FNW posted a CVS change based on what was going on, and it was right, sorta =P


grab the new cvs, fix the updateclientstruct so you can actually move around, then in attack.cpp, do this:


in client::death , after addCorpse like shown

entity_list.AddCorpse(new_corpse, GetID());

+ //become a corpse
+ EQZonePacket app(OP_BecomeCorpse, sizeof(BecomeCorpse_Struct));
+ BecomeCorpse_Struct* d = (BecomeCorpse_Struct*)app.pBuffer;
+ d->spawn_id = GetID();
+ d->x = GetX();
+ d->y = GetY();
+ d->z = GetZ();
+ entity_list.QueueClients(this, &app, true);

+ this->SetID(0);


Remove the //become a corpse through entity_list.Queueclients() from the top of the file and bring it down. You will need to change the name of the app and d variables on the second packet sent in client::death, because someone forgot to name them seperately =P

Thats it! :) enjoy

Magoth78 09-20-2005 09:00 AM

Many thanks :D

Dakaar 09-20-2005 11:13 AM

Quote:

Originally Posted by Magoth78
Many thanks :D

Yup :)

....gonna work on bards next *shudder* =P

Magoth78 09-20-2005 10:52 PM

too bad for me EQZonePacket is not declared in 6.0dr2 :x
I'm gonna declare it and see how it does work.

Mag

----
Edit: Btw, just found a way to not get the "Pain and suffering" bug death. IN attack.cpp, you just have to add a case where if(other == NULL), you add a corpse.

Magoth78 09-20-2005 11:37 PM

Ok, here's the fix for versions 0.6.0dr2 and mebbe dr3:

In attack.cpp, after
Code:

entity_list.AddCorpse(new_corpse, this->GetID());
add:
Code:

APPLAYER app;
  CreateSpawnPacket(&app, new_corpse);
  Corpse* dcorpse = entity_list.GetCorpseByID(GetID());
  if(dcorpse->IsPlayerCorpse())
  entity_list.QueueClients(this, &app, true);
  entity_list.RemoveFromTargets(this);
  safe_delete(trade);
  this->SetID(0);

I've tested it, it seems to work well.
Thanks again Dakaar and FNW for the direction.

Mag

Dakaar 09-21-2005 06:50 AM

Can anyone help me figure out how I would have some sort of inter-zone corpse retrieval? Basically id like to after say two minutes, retrieve the corpse from the other zone to prevent corpse camping

Magoth78 09-22-2005 07:00 AM

I've done a thing like that on Empire. But it's not coded.

I've just added a php script on my server's website that move the corpse to a zone that I've called The Sanctuary (it must be a dynamic zone). Once the corpse is moved, the character can zone in (that will bootup the zone so the corpse will appear) and can loot it, then he will leave the zone.

Ghetto way but it's working :x

Mag
ps: if you want the script, just ask.

Dakaar 09-22-2005 05:14 PM

Yeah I do, toss me a message next time you see me (yablargo) in #support. Lord knows ill be there for a while with all my linux issues =P

Magoth78 09-22-2005 09:28 PM

Code:


<?php

$host = 'dbhost';
$dbuser = 'dbuser';
$dbpass = 'dbpass';
$db = 'dbname';

$link = mysql_connect($host, $dbuser, $dbpass)
  OR die(mysql_error());

if (!mysql_select_db($db, $link))
        {
            echo 'Unable to connect to the database.';
        echo mysql_errno($link) . ": " . mysql_error($link). "\n";
            exit;
        }


$charname = $_POST['charname'];
$accountname = $_POST['accountname'];


$query3 = mysql_query("SELECT account_id FROM character_ WHERE name='$charname';");
        if (!$query3) {
          die('Could not query:' . mysql_error());
        }
        $find_accountid = mysql_result($query3, 0);
       

$query3a = mysql_query("SELECT id FROM account WHERE name='$accountname';");
        if (!$query3a) {
          die('Could not query:' . mysql_error());
        }
        $verifyaccount_id = mysql_result($query3a, 0);
       


                if($find_accountid != $verifyaccount_id)
                {
                echo ("Account name matched with this char ...  <b> Failed! </b> \r\n <br> <b> Verify your Character's name and your's Account's name!");
                mysql_close($link);
                exit;
                }
               

                if($find_accountid = $verifyaccount_id)
                {
                        echo ("Account name matched with this char ...  <b> Ok! </b> \r\n <br>");
                        $corpsemove = mysql_query("UPDATE player_corpses  SET zoneid='your_zone_id', x='0', y='0', z='0', rezzed='1'  WHERE charname='$charname';");
                        if (!$corpsemove) {
                          die('Could not query:' . mysql_error());
                        echo ("Error moving the corpses... \r\n");
                        }
                        echo "Corpse(s) moved to the sanctuary. \r\n";
                        mysql_close($link);
                }

?>

Here's the script. You can change the zone where you want to move the corpse, change the locations, the rezz status etc...

You have to make a html page with a form and 2 entries: charname and accountname so it verifies if the entries match before sending the corpse.

Mag


All times are GMT -4. The time now is 08:57 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.