Jump to content

Opponent's hp quest


Recommended Posts

Hi! I found this quest on epvp from Vegas, and it works, I've just a problem. 

The syschat is printed twice when get killed and I can't fix it

 

  
	quest hp_opponent_info begin
    state start begin
        when kill with npc.is_pc() begin
            local opponent
                if pc.get_sex() == 0 then
                    opponent = "he"
                else
                    opponent = "she"
                end
            local remaining_life = pc.get_hp()
            local obtaining_names = pc.get_name()
            local killing_enemy = npc.get_vid()
	                if killing_enemy == 0 or killing_enemy == pc.get_vid() then
                    return
                end
	            local old_opponent = pc.select(killing_enemy)
                syschat("You were killed by '"..obtaining_names.."', and "..opponent.." remained with "..remaining_life.." hp")
                pc.select(old_opponent)
        end
    end
end
	  

 

Link to comment
Share on other sites

  • Premium
	                if killing_enemy == 0 or killing_enemy == pc.get_vid() then
                    return
                end

o boi

 

btw, the bug is source-sided, it's known that kill triggers trigger twice for players.

Solution:

Search this line in the questmanager.cpp file:

m_mapNPC[npc].OnKill(*pPC);

Substitute with:

 

if (npc > 0)
{
    m_mapNPC[npc].OnKill(*pPC);
}
  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

Ah sorry, i didn't know it :( I'm newbe with this, btw thanks so much, i'll try it right now

------------- Edit --------------

Je t'aime! It works perfectly, thank you very much!

Can I ask you how to improve the quest? I've noticed you didn't appreciated this part

 

	                if killing_enemy == 0 or killing_enemy == pc.get_vid() then
                    return
                end[/CODE]

and if this don't disturb you, can i ask you to tell me how make this quest print even if the killing player is buffed by group skill? or just if it is in a group.

Anyway thanks again, no problem if you don't answer to these questions

Link to comment
Share on other sites

  • Premium

I can't print if player is buffed, there is no function for that.

to improve the quest, remove all that ..thing..i've quoted, it's useless coding.

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.