Jump to content

Give item after kill monster [c++]


Recommended Posts

  • Active+ Member

Hi community,

How can i make in c++ system, when i kill a monster / boss, you get a reward for it?
(But only the one who killed in other words, the one who did last hit.)

I tried some stuff, but nothing works like i want.

If someone can help please i appreciate.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

search

void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)

 

add something like this,  and change mobvnum and ITEM

 

    if (true == IsMonster() && MOBVNUM == GetMobTable().dwVnum)
    {
        if (pkKiller->IsPC() )
        {
            pkKiller->AutoGiveItem(ITEM);
        }
    }

Link to comment
Share on other sites

  • Active+ Member

yy, i searched for that after 15 mins after i posted it,

Thanks anyway ! :D

Can close topic, solution founded.

For those who want, comment from "useless69".

Char_battle.cpp

Edited by Doose
Link to comment
Share on other sites

  • Active+ Member
23 hours ago, Mali61 said:

I think it's better to use quests for this kind of things.  No need to mess the src.

Ty, i also did the same and it worked too.

Can you explain me how to use a green potion and purple one per time for time of use?
I mean, if the potion takes 10 mins to be complitly used, how can i make a condition to make it only used 1 time per 10 mins?

In other words, i can only use 1 green potion every 10 minutes, even if die.

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.