Forum > Serverside Modding

[QUESTION] Honor/HonorKills From NPC

(1/1)

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.

stoneharry:

--- 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.
--- End quote ---

A very simple script:


--- Code: ---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.");
    }
}
--- End code ---

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. :)

Sho:
Thanks, ill try it this helps alot.

Navigation

[0] Message Index

Go to full version