Jump to content
Maintenance ×
×
×
  • Create New...
  • 0

Opponent's hp quest


Aioria

Question

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

4 answers to this question

Recommended Posts

  • 0
  • 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

  • 0

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

  • 0
  • 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 4

      problem Dargon Soul Changre Attribute

    2. 41

      Global Chat

    3. 4

      problem Dargon Soul Changre Attribute

    4. 2

      Startup Loading Window Library

    5. 28

      Ludus2: metin2 fan project

    6. 44

      Inbuild GR2 Animation

    7. 6

      Minimap Mob proto

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.