Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: Sho on June 14, 2012, 04:53:59 pm

Title: [QUESTION] Honor/HonorKills From NPC
Post by: Sho on June 14, 2012, 04:53:59 pm
Hey I was looking for some way to add honor/honor kills to an npc, so say you kill an npc and you get 5 honor and 1 honor kill.  Reason I want this is because I wanted to add a title system and for honor and honor kills, but the mobs are the honorable kills you need for the titles. Thanks Ahead :D


Trinitycore 3.3.5


I do know dbc, Editing and  sql and  some C++ , all the basic stuff you would need to do this with but dont know where to start.

Sho.
Title: Re: [QUESTION] Honor/HonorKills From NPC
Post by: stoneharry on June 15, 2012, 01:02:31 am
Quote from: "Sho"
Hey I was looking for some way to add honor/honor kills to an npc, so say you kill an npc and you get 5 honor and 1 honor kill.  Reason I want this is because I wanted to add a title system and for honor and honor kills, but the mobs are the honorable kills you need for the titles. Thanks Ahead :D


Trinitycore 3.3.5


I do know dbc, Editing and  sql and  some C++ , all the basic stuff you would need to do this with but dont know where to start.

Sho.

A very simple script:

Code: [Select]
public void unitDeath(Unit * unit, int Event)
{
    Player plr = unit->GetClosestPlayer();
    if (plr != null)
    {
        plr->ModHonorPoints(plr->GetHonorPoints() + 1));
        plr->SendBroadcast("Your honor points have increased by 1.");
    }
}

That is the psuedocode, however the actual parameters and API is probably very much different. Also you need to figure out how to hook it, for which I recommend looking at how existing instances are scripted. Once you figure out those two points by looking then copy + pasting, you can add your hook and function to a existing unit script that is already set up, or try and hook a new project to the main solution.

Good luck, sorry I can't be of more help with TrinityCore. :)
Title: Re: [QUESTION] Honor/HonorKills From NPC
Post by: Sho on June 15, 2012, 10:08:42 am
Thanks, ill try it this helps alot.