EQEmulator Forums

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

ChaosSlayerZ 06-03-2009 06:20 PM

sub EVENT_DEATH?
 
I have question on sub EVENT_DEATH

I like to make it so when NPC dies the player who killed him gets an item.

Scriptwise its seems simple

sub EVENT_DEATH
{
quest::summonitem(11242);
}


but what bothers me, what if player in a group? who will get the item? who ever was top on agro list at time of death? player who delt kiling blow? entire group?

thanks!

trevius 06-03-2009 06:34 PM

Only the person that lands the killing blow will get anything from EVENT_DEATH. If you want the group to get it, you can use EVENT_KILLED_MERIT.

I think EVENT_DEATH isn't a very good way to give rewards, because someone from outside the group can come in and get the last hit and get the reward. At least with EVENT_KILLED_MERIT, you ensure that the group who got the exp will get the reward. If you only want 1 character to get the reward, you could probably do some kind of random to give a random chance for someone to get it, but it wouldn't be easy to ensure that only 1 person gets the reward each time.

You might be better off using the quest::addloot() command to add loot to the corpse during the fight. I don't think you can add loot upon death, but, it might be worth trying just to see if you can.

ChaosSlayerZ 06-03-2009 06:41 PM

ok to be more specific.

player is on a quest - prbaobly with usage of quest global

quest meant as solo quest.

so reward should be given ONLY if a player has a global variable flag set

at same time if using MERIT event - not entire group should get the reward item but only those who actualy had the flag set, since we do not know who a player may be groping with and do not want to give reward to entire group since some of them may be on the quest, whiel others are not

essentialy i am trying to emulate wow/eq2 system where mob ONLY drops a quest item for a player who is actualy on the quest for that item

trevius 06-03-2009 06:51 PM

Yeah, then you want to use Merit for that. You would just have a check for the qglobal in the Merit event and give the item to anyone with that qglobal that is getting Merit for the kill.

You could also still do this during the fight if you wanted by using addloot(), but that all depends on how you want to do things. Also, if you are using the task system, you can avoid using qglobals for this completely. You would just be able to check if they had a certain task and were on a certain step and then give them the reward if so. Many of the same things can be accomplished by using either qglobals or Tasks. It is all just about how you want the quest to happen. Basically, if you want to use the task window and task system, then tasks are the way to go, but if not, then qglobals are another option.

caylah023 06-04-2009 02:15 PM

ok i got a question is it possible to say....make that sub event death then quest summonitem thing work when you kill another player.

player one kills player two and suddenly he gets an item?

joligario 06-04-2009 03:51 PM

Probably the player.pl


All times are GMT -4. The time now is 07:50 PM.

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