EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   COMMITTED: Pass Corpse Name to EVENT_LOOT (https://www.eqemulator.org/forums/showthread.php?t=31545)

joligario 06-27-2010 12:02 PM

COMMITTED: Pass Corpse Name to EVENT_LOOT
 
The following changes allow the name of the corpse to be passed to perl in the EVENT_LOOT sub as $corpse in the NPC database name format such as "a_ra`tuk_screambringer" or "#Viarglug".

Code:

Index: zone/embparser.cpp
===================================================================
--- zone/embparser.cpp        (revision 1575)
+++ zone/embparser.cpp        (working copy)
@@ -594,6 +594,7 @@
                        Seperator *sep = new Seperator(data);
                        ExportVar(packagename.c_str(), "looted_id", sep->arg[0]);
                        ExportVar(packagename.c_str(), "looted_charges", sep->arg[1]);
+                        ExportVar(packagename.c_str(), "corpse", sep->arg[2]);
                        safe_delete(sep);
                        break;
                }
Index: zone/PlayerCorpse.cpp
===================================================================
--- zone/PlayerCorpse.cpp        (revision 1575)
+++ zone/PlayerCorpse.cpp        (working copy)
@@ -1057,9 +1057,12 @@
                }
 
 #ifdef EMBPERL
-                char buf[24];
-                snprintf(buf, 23, "%d %d", inst->GetItem()->ID, inst->GetCharges());
-                buf[23] = '\0';
+                char buf[88];
+                char corpse_name[64];
+                strcpy(corpse_name, orgname);
+                EntityList::RemoveNumbers(corpse_name);
+                snprintf(buf, 87, "%d %d %s", inst->GetItem()->ID, inst->GetCharges(), corpse_name);
+                buf[87] = '\0';
                ((PerlembParser*)parse)->Event(EVENT_LOOT, 0, buf, (NPC*)NULL, client);
 #endif



All times are GMT -4. The time now is 06:42 AM.

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