function detecting died player.

08/07/2013 09:48 Cetus#1
Is there any function or event that I can use in quest file wich triggers event after when player dies?

function pc.is_dead() is boolean type, but i need to do something like that:

Code:
when (player_dies) begin
-- some actions
end
I could use a timer for that, but loop seems makes no sense.
"Unnecessary extra server load"
08/07/2013 10:03 Mijago#2
If you have npc.get_vid():
Code:
when kill with npc.is_pc() begin
    local me = pc.select(npc.get_vid())
    do
        -- do whatever you want to do
    end
    pc.select(me)
end
So you can check, whether he dies in pvp..
08/07/2013 11:12 Cetus#3
Quote:
Originally Posted by Mijago View Post
If you have npc.get_vid():
Code:
when kill with npc.is_pc() begin
    local me = pc.select(npc.get_vid())
    do
        -- do whatever you want to do
    end
    pc.select(me)
end
So you can check, whether he dies in pvp..
What you gave me is almost what I need, but there is a major difference between your solution and my target.

Your code detects player which I kill, I need to write quest, wich tells me that I'm dead. Precisely say:

Code:
when kill begin
This triggers action when my character kills something (mob or player)

I'd like to do something like:

1. I'm on a quest to find spider leg, but npc gave me condition to complete quest
"Remember, you can't die in battle with any spider"
I aqquire spider leg and everyting is ok, but, when spider kills me, mission is failed.