EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Event death (https://www.eqemulator.org/forums/showthread.php?t=41236)

Excuses 03-25-2017 02:35 AM

Event death
 
Hey guys,

In regards to event on death and death complete, i was wondering if it's possible to reward players a LDoN currency, when they die? i have tried a few ways, even the simplest way:

sub EVENT_DEATH_COMPLETE {

quest::addldonpoints("15", 1);

}

But obviously, not exactly like that because it would have to reward the $name of who killed him, i have tried several ways but cannot seem to pinpoint it, any hints?

GRUMPY 03-25-2017 02:44 AM

Is that planning on rewarding only one player or, if a group, all players for the kill ?

Excuses 03-25-2017 02:50 AM

All players would be nice, or both.

GRUMPY 03-25-2017 02:53 AM

Did you try setting that second value "theme" to 0 ? Not sure if that would work, haha

ghanja 03-25-2017 10:27 AM

EVENT_DEATH_COMPLETE's initiator is the one who did the killing, I believe. (I'd have to look again). But, I assume you were using that code in the /quests/global/global_player.pl

If so, and it didn't work, then, I suspect the one doing the killing is indeed the initiator.

So try this instead:

Code:

sub EVENT_DEATH_COMPLETE
{
        if ($entity_list->GetMobByID($killer_id)->IsNPC())
        {
                $client->UpdateLDoNPoints(15, 1);
        }
}

Points is a long integer last time I checked, so, there is no need to place it in quotes (though I'm assuming what you posted was just one of many iterations trying to get it to work, so it's just a fyi).

Excuses 03-25-2017 06:47 PM

Yea i was wondering if i needed it in the global_player.pl, i shall try that, i actually used it on the npc being killed's .pl script, so i could make only those npcs give the credit.

ghanja 03-25-2017 06:54 PM

Quote:

Originally Posted by Excuses (Post 253845)
Yea i was wondering if i needed it in the global_player.pl, i shall try that, i actually used it on the npc being killed's .pl script, so i could make only those npcs give the credit.

Well no you dont need to use global_player (it's just another angle one could go), if you want to use this on only specific NPC's then, you have two choices. Use the global NPC script /quests/global/global_npc.pl, or zone based "global" NPC script /quests/<zonesn>/default.pl in either case you'd use EVENT_SLAY

ghanja 03-25-2017 06:58 PM

Actually, I'd have to test. I'm not even sure (yet) if the NPC has a target, thus able to identify the entity that it slayed, in the EVENT_SLAY. I'll have to look, however, going by the wiki, I don't see any exported variables for that particular event.

NatedogEZ 03-26-2017 03:33 AM

Use "EVENT_KILLED_MERIT" as it will give credit to all players that were in the party /raid that killed the NPC.


This would be used on an NPC type script.

Code:

sub EVENT_KILLED_MERIT {
$client->UpdateLDoNPoints(15, 1);
}


Excuses 03-27-2017 12:53 AM

That's awesome, thanks alot Nate!

Quote:

Originally Posted by NatedogEZ (Post 253866)
Use "EVENT_KILLED_MERIT" as it will give credit to all players that were in the party /raid that killed the NPC.


This would be used on an NPC type script.

Code:

sub EVENT_KILLED_MERIT {
$client->UpdateLDoNPoints(15, 1);
}



Excuses 03-27-2017 02:14 AM

Hmm afraid not Nate, didn't seem to update? Does it matter if it is a version of a zone i have edited?

GRUMPY 03-27-2017 03:17 AM

I tried this just for the fun of it, but it didn't work for me either. I even tried getting the
task, then trying it and still nothing.

atrayas 03-27-2017 11:03 AM

With sub_event_killed_merit I found that alot of the currency's would not update until you zone.

ghanja 03-27-2017 11:14 AM

EVENT_KILLED_MERIT I believed was an NPC event, where initiators are those individuals, group or raid that received experience from the kill. Id have to confirm with the source to be sure in case of behavior change or such. However, the event death complete code I provided should do just fine?

You could try to $client->UpdateAdmin() after giving the points.

ghanja 03-27-2017 11:16 AM

I mean you are looking to give ldon points for a players death right, it's how your OP reads anyway.


All times are GMT -4. The time now is 05:46 AM.

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