[Complete] Honor from NPCs (Updated 2014-08-29)

Updates:

[ul]
[li]2014-08-29[/li]Removed patch, submitted PR

[/ul]

[SIZE=14px][COLOR=rgb(165,42,42)]Past Updates:[/SIZE]

[ul]
[li]2014-07-27[/li]
Added note about honor from group kills to the “Details” section below
[/ul]

[li]2014-07-26[/li][ul]Implemented config option for messages if player reaches min level set in config. There are two options:

CreatureHonor.LevelReached.Message - Display a custom message
[li]CreatureHonor.LevelReached.CreatureMessage - Display the list of NPCs that award honor[/li]
[li]See screenshot section below[/li][/ul]

[li]2014-07-25[/li][ul]
Cleaned up config descriptions, changed some default values
[li]Implemented config option for PvP flag for Players[/li][li]Implemented config option for PvP flag for NPCs[/li][li]Implemented config option for disabling honor from neutral[/li][li]Implemented config option for subtracting honor for targets below level[/li]
See CONFIG for notes about client sounds when subtracting rep
[/ul]

[li]Fixed 3 bugs[/li][ul]
CalcHonor()
[li]IsHonorEnabled()[/li][li]Pet getting killing blow not counting[/li][/ul]

[li]Added a ToDo section[/li]

[li]2014-07-24[/li][ul]
Added ‘Fixed Issues’ section
[li]Added another bug to ‘Known Issues’[/li][/ul]

[li]2014-07-23[/li][ul]
Initial release
[/ul]

General Info:

This patch allows server admins to configure the ability for players to earn honor from killing NPCs.

It was developed mainly because I wanted a way to gain honor while on a server solo. After looking around the forums I found some old, incomplete patches and a recommendation by +Nay that this should be a script, not a core modification. Since I eventually would like this to be in the core permanently I thought I’d write the script and put it here for testing (also I needed to refresh my script writing skills).

Details:

[ul]
[li]The patch is for 3.3.5a (though it may work on others)[/li][li]The patch currently does not provide honor from NPCs killed by group members except for the person who gets the killing blow. I have no plans at this time to implement a “group kills” feature[/li]
The patch already makes it easy to gain honor
[li]By only allowing honor to killing blows, it makes group members have to participate in battle rather than AFK and be carried to max honor.[/li][/ul]

[li]The patch is highly customizable[/li][li]Open the spoiler to see all the CONF options and details[/li][ul]
Note: You do not need to copy this manually, it is in the patch. This is just easier to read than a DIFF.

[/ul]

###################################################################################################

CUSTOM SERVER OPTIONS - CREATURE HONOR

player_creature_honor is a script that when enabled, allows players to gain honor

from killing NPCs. These options define how the script should work.

CreatureHonor General Settings

These settings are general script settings

CreatureHonor.Enabled

Description: Is the script enabled

Default: 0 - (disabled)

1 - (Enabled)

CreatureHonor.Allow.Achievement

Description: Should the player gain honorable kill achievement points for NPC kills that reward honor

Default: 0 - (disabled)

1 - (Enabled)

CreatureHonor.Allow.InstancesOnly

Description: Allow only NPCs in instances to reward honor

Default: 1 - (enabled)

0 - (disabled)

CreatureHonor.Player.Minlevel

Description: The minimum level the player can start earning honor from NPC kills

Default: 10

CreatureHonor.Require.XP

Description: If NPC must be a level that would normally give XP

Default: 1 - (enabled)

0 - (disabled)

CreatureHonor.Creature.BonusLevelDiff

Description: If NPC level is this many levels above player, apply a bonus

Default: 5 - (bonus for 5+ level difference)

0 - (disabled, no bonus applied. Note negative values are considered disabled)

CreatureHonor.Allow.Neutral

Description: Allow earning honor from neutral NPCs if that NPC type is enabled

Default: 1 - (enabled)

0 - (disabled)

CreatureHonor.Creature.PenaltyLevelDiff

Description: If NPC level is below the player’s level minus this value, subtract the honor instead. If you

enable “Require.XP” and the NPC would not award XP then this setting has no effect.

NOTE: When honor is subtracted, the client makes the “coin” sound, the same sound as when

you spend money at a vendor. It is a client “feature” and can’t be turned off in the script.

Default: 5 - (penalty for 5- level difference)

0 - (disabled, no penalty. Note: Negative values are condisered disabled)

CreatureHonor.Require.PlayerPvP

Description: If player must have PvP flag enabled to gain honor

Default: 1 - (enabled)

0 - (disabled)

CreatureHonor.Require.CreaturePvP

Description: If NPC must have PvP flag enabled to gain honor

Default: 1 - (enabled)

0 - (disabled)

CreatureHonor.LevelReached.Message

Description: If CreatureHonor.Player.Minlevel is defined, display this message as a MOTD

Use ‘@’ for a newline and be sure to escape special characters. Empty quotes for no message (“”).

Default: “Congratulations, you are now able to earn honor@from NPC kills. Good hunting!”

CreatureHonor.LevelReached.CreatureMessage

Description: If CreatureHonor.Player.Minlevel is defined, display the list of allowed NPCs as a MOTD

Default: 1 - (enabled)

0 - (disabled)

CreatureHonor.Enabled = 0
CreatureHonor.Allow.Achievement = 0
CreatureHonor.Allow.InstancesOnly = 1
CreatureHonor.Player.Minlevel = 10
CreatureHonor.Require.XP = 1
CreatureHonor.Creature.BonusLevelDiff = 5
CreatureHonor.Allow.Neutral = 1
CreatureHonor.Creature.PenaltyLevelDiff = 0
CreatureHonor.Require.PlayerPvP = 1
CreatureHonor.Require.CreaturePvP = 1
CreatureHonor.LevelReached.Message = “Congratulations, you are now able to earn honor@from NPC kills. Good hunting!”
CreatureHonor.LevelReached.CreatureMessage = 1

CreatureHonor Base Rates

These settings define the minimum honor received for killing an NPC

CreatureHonor.Rate.Normal

Description: The amount of base honor earned for a normal NPC

Default: 2

CreatureHonor.Rate.Elite

Description: The amount of base honor earned for an elite NPC

Default: 5

CreatureHonor.Rate.Normal = 2
CreatureHonor.Rate.Elite = 5

CreatureHonor Bonuses

These rates define bonuses applied to the base honor rate. These bonuses are accumulative so a player

can get multiple extra bonuses applied depending on the NPC type (eg: A Guard who is at LevelDiffBonus)

CreatureHonor.Rate.GuardBonus

Description: The amount of bonus honor added to base honor for guard NPCs

Default: 2

CreatureHonor.Rate.LevelDiffBonus

Description: The amount of bonus honor added to base honor for NPCs based on CreatureHonor.Creature.BonusLevelDiff

Default: 5

CreatureHonor.Rate.RareEliteBonus

Description: The amount of bonus honor added to base honor for rare elite NPCs

Default: 2

CreatureHonor.Rate.WorldBossBonus

Description: The amount of bonus honor added to base honor for racial leader NPCs

Default: 5

CreatureHonor.Rate.RacialLeaderBonus

Description: The amount of bonus honor added to base honor for world boss NPCs

Default: 5

CreatureHonor.Rate.GuardBonus = 2
CreatureHonor.Rate.LevelDiffBonus = 5
CreatureHonor.Rate.RareEliteBonus = 2
CreatureHonor.Rate.WorldBossBonus = 5
CreatureHonor.Rate.RacialLeaderBonus = 5

CreatureHonor Creature Type Flags

These settings determine if a particular NPC type can reward honor. These are modified

by other settings so enabling a creature type doesn’t guarantee honor, only that it can

be considered.

For example, enabling Humanoid and disabling CreatureHonor.Allow.Neutral means any neutral

Humanoid killed can not reward honor.

CreatureHonor.Allow.Beasts

Default: 0 - (do not allow)

1 - (allow)

CreatureHonor.Allow.Dragonkin

Default: 1 - (allow)

0 - (do not allow)

CreatureHonor.Allow.Demon

Default: 1 - (allow)

0 - (do not allow)

CreatureHonor.Allow.Elemental

Default: 0 - (do not allow)

1 - (allow)

CreatureHonor.Allow.Giant

Default: 1 - (allow)

0 - (do not allow)

CreatureHonor.Allow.Undead

Default: 1 - (allow)

0 - (do not allow)

CreatureHonor.Allow.Humanoid

Default: 1 - (allow)

0 - (do not allow)

CreatureHonor.Allow.Mechanical

Default: 0 - (do not allow)

1 - (allow)

CreatureHonor.Allow.Beasts = 0
CreatureHonor.Allow.Dragonkin = 1
CreatureHonor.Allow.Demon = 1
CreatureHonor.Allow.Elemental = 0
CreatureHonor.Allow.Giant = 1
CreatureHonor.Allow.Undead = 1
CreatureHonor.Allow.Humanoid = 1
CreatureHonor.Allow.Mechanical = 0

###################################################################################################

Fixed Issues (3):

[ol]
[li]Fixed A bug in IsHonorEnabled() which sometimes caused it to return the wrong value[/li] [li]Fixed a bug where Players did not get honor if their pet got the killing blow[/li] [li]Fixed A bug in CalcHonor() that can cause players to go negative if penaltyLevelDiff is enabled and they kill too many low level NPCs[/li][/ol]

Known Issues (0):

[ul]
[li]Note: Issues marked as Testing indicate that a fix is being tested[/li][/ul]
[ul]
[li]None[/li][/ul]

ToDo (0):

[ol]
[li]None[/li][/ol]

Screenshots (1):

[ul][li]Example of CreatureHonor.LevelReached.Message and CreatureHonor.LevelReached.CreatureMessage[/li]
The LevelReached.Message starts with Congratulations and the LevelReached.CreatureMessage starts with * Honor from NPCs, allowed NPCs are.

Note: LevelReached.CreatureMessage is built on the fly by the script based on which creature types and other rules are enabled in the CONF. This message is not directly supplied by the server admin.

http://i60.tinypic.com/r29g8i.jpg

[/ul]

Patch:

[ul]
[li]The patch has been removed and a PR has been submitted[/li][/ul]

MrSmite thanks for making this. I haven’t touched anything TC related in at least 7 months, but I’m still dropping by on this site every now and then. Just thought I’d give you an interent shoulder tap.

You’re welcome.

Sorry for the stupid question, i’m quite new here: How to add this patch to my server?

I like the idea to be able to let player gain honor just with NPC flagged for PVP like city guards.