I've played on servers where there are archery-targets that when you /attack/ they spit out a number, etc.. and so two or more char's can duel it out to see who's the best shots...
One thing I've disliked about these is that the targets are all set up for pretty much high-level archers only... the scripts are a blanket AC (or similar) and low level characters pretty much have no real chance of scoring any points.. which translates into ONLY the high-level characters using the targets -and even then, they often always get bulls-eyes, and that isn't much of a competition, now is it.
I've found, this usually is because the Archery Target Script goes off of the attack-roll of the archer, and compares it to a set score, and assigns that score based on the attack-roll total...
12-years back, while part of the dev-team for my server, I implemented a script that I could modify for three separate archer-target fixtures, and would just label them "Easy" "Moderate" and "Hard" -then the low level archers (or low-dex PC's) could have a fairly tight competition on the EASY targets, while the high level AA's could duke it out on the "hard" targets. -the original script was written prior to the introduction of Arcane Archers to NWN, My modifications are marked with the "Modified by Kona" comments.
I had it originally set up with an archery-range that had three targets: an easy target, a medium target and a hard target... I needed three custom items in the palate, but it was fine, I just put three targets out on the archery-field.
(disclaimer: I'm no scripting wizard or anything, I merely modified a script that I stole from a NWVault download)
So, My suggestion here is that maybe someone might like to use this old script of mine... and modify it so that instead of having three separate archery-targets... a PC could interact with a single-target... and through a dialogue, put that target into Easy, Moderate, or Hard mode... and that way the individuals doing the RP-Archery Contest, could set up the difficulty level they wished, and then go about their own business of the competition... then someone else could come along, shift it into a DIFFERENT difficulty level, and have a much different contest difficulty!
Before I list the code, here is a brief summary of what happens in the script.
This script doesn't use the attack-roll to determine the score of the arrow-fired. Instead, (on-attacked) it generates a random number between 1-100, and then compares that result to the paramaters of:
1-25 = 1 point
26-50 = 2 points
51-70 = 3 points
71-90 = 4 points
90-100 = BULLS EYE!!
The idea here is that a level 0 human with a 10 Dex would have at least a CHANCE of even accidentally hitting a Bullseye.
Based on the above statement, the random 1-100 number is given a bonus for each of the following factors before it generates it's final "Score"
1) proficiency with bows
2) focus on bows
3) EPIC focus on bows
4) specialization on bows
5) EPIC specialization on bows
6) Dex modifier (If Zen Archery then replaces Dexterity with Wisdom)
7) base attack bonus
8) up to 40 Arcane Archer levels
Based on the above criteria, a level 0 human with a 10 DEX could STILL hit a bullseye.. it would just be very unlikely...
...and a level 12-Bard/8-AA would have a much higher chance of scoring that bullseye, and a Fighter-9/Wizard-1/AA-20 would nail a bullseye every time.
In the below code.. a level 30 fighter with an 11 dex and no archery-feats or other bonuses at all, would still kick the butt of a level 0 human with 10 Dex with the "Easy-Mode" target.. but when he/she moves over to the "HARD" target... yeah, there is STILL that ~chance~ to score a bullseye... but it is much less likely.
The idea here is that PC's of different similar skill/level can effectively compete against each other in Easy, Moderate, or Hard mode (based on how challenging they want the target to be)...
...Archery doesn't have to be JUST for the archers, after all... ;)
Here's the code:
Code:
//slightly modified version of the original script "jh_archerytarget"
// 3 versions for easy(1) medium(2) or difficult(3) targets
// easy = standard range score from original script,
// medium = ranges increase +35
// difficult = ranges increase +75
// getting objects we need
object oPC = GetLastAttacker();
object oTarget = OBJECT_SELF;
void heal();
void speakIt();
void shoot();
void main()
{
// setting things ready, by reseting the score and healing the target
SetLocalInt(oTarget,"total",0);
heal();
//calculate the score
shoot();
//speak the score
speakIt();
}
// this function will heal the target to max hitpoints
void heal() {
int hp = GetMaxHitPoints(oTarget) - GetCurrentHitPoints(oTarget);
if ( hp > 0 ) {
effect eff = EffectHeal(hp);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eff, oTarget, 0.0);
}
}
// this function speaks the result
void speakIt() {
int nTotal = GetLocalInt(oTarget,"total");
string sTotal = IntToString(nTotal);
string sIt = "HIT! You score " + sTotal + " points.";
DelayCommand(1.5,
AssignCommand( oPC, SpeakString(sIt,TALKVOLUME_TALK) ) ); }
// this function calculates the how good the player hits.
// it takes these factors into considerations:
// 1. Random
// 2. Proficiency with bows
// 3. Focus on bows
// 4. EPIC focus on bows
// 5. Specialization on bows
// 6. EPIC specialization on bows
// 7. Dexterity modifier
// 8. Zen Archery replaces dexterity with wisdom
// 9. BAB
// 10. up to 40 Arcane Archer levels
void shoot() {
int nPoint;
int nScore = d100();
// bonus granted to make more able PCs hit better
// bonus for proficiency in bows
if ( GetHasFeat(FEAT_WEAPON_PROFICIENCY_MARTIAL,oPC) ) nScore += 5;
// bonus for focus in bows
if ( GetHasFeat(FEAT_WEAPON_FOCUS_LONGBOW,oPC) ||
GetHasFeat(FEAT_WEAPON_FOCUS_SHORTBOW,oPC)) nScore += 10;
// bonus for specialization in bows
if ( GetHasFeat(FEAT_WEAPON_SPECIALIZATION_LONGBOW,oPC) ||
GetHasFeat(FEAT_WEAPON_SPECIALIZATION_SHORTBOW,oPC)) nScore += 10;
// bonus for improved critical (better accuracy) **added by Kona 12/2/04
if ( GetHasFeat(FEAT_IMPROVED_CRITICAL_LONGBOW,oPC) ||
GetHasFeat(FEAT_IMPROVED_CRITICAL_SHORTBOW,oPC)) nScore += 10;
// bonus for EPIC focus in bows **added by Kona 12/2/04
if ( GetHasFeat(FEAT_EPIC_WEAPON_FOCUS_LONGBOW,oPC) ||
GetHasFeat(FEAT_EPIC_WEAPON_FOCUS_SHORTBOW,oPC)) nScore += 10;
// bonus for EPIC specialization in bows **added by Kona 12/2/04
if ( GetHasFeat(FEAT_EPIC_WEAPON_SPECIALIZATION_LONGBOW,oPC) ||
GetHasFeat(FEAT_EPIC_WEAPON_SPECIALIZATION_SHORTBOW,oPC)) nScore += 10;
// bonus to account for Arcane Archer Levels **added by Kona 12/2/04
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_1,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_2,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_3,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_4,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_5,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_6,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_7,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_8,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_9,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_10,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_11,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_12,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_13,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_14,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_15,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_16,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_17,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_18,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_19,oPC)) nScore += 1;
if ( GetHasFeat(FEAT_PRESTIGE_ENCHANT_ARROW_20,oPC)) nScore += 1;
// adds (or subtracts) dexterity modifier
nScore += GetAbilityModifier(ABILITY_DEXTERITY,oPC);
// adds wisdom modifier and subtracts dexterity for Zen Archery feat **added by Kona 12/2/04
if ( GetHasFeat(FEAT_ZEN_ARCHERY,oPC)) nScore += GetAbilityModifier(ABILITY_WISDOM,oPC);
if ( GetHasFeat(FEAT_ZEN_ARCHERY,oPC)) nScore -= GetAbilityModifier(ABILITY_DEXTERITY,oPC);
// adds Base Attack **added by Kona 12/2/04
nScore += GetBaseAttackBonus(oPC);
// convert 100 into the point range of 1,2,4,6,8,10
// uncomment for easy, medium or difficult
// easy score ranges
if (nScore <= 0) {nPoint=0;}
if ((nScore > 0) && (nScore <= 25)) {nPoint=1;}
if ((nScore > 25) && (nScore <= 50)) {nPoint=2;}
if ((nScore > 50) && (nScore <= 70)) {nPoint=4;}
if ((nScore > 70) && (nScore <= 90)) {nPoint=6;}
if ((nScore > 90) && (nScore <= 99)) {nPoint=8;}
if (nScore > 99) {nPoint = 10;}
// medium score ranges (easy score +35)
//if (nScore <= 0) {nPoint=0;}
//if ((nScore > 0) && (nScore <= 60)) {nPoint=1;}
//if ((nScore > 60) && (nScore <= 85)) {nPoint=2;}
//if ((nScore > 85) && (nScore <= 105)) {nPoint=4;}
//if ((nScore > 105) && (nScore <= 125)) {nPoint=6;}
//if ((nScore > 125) && (nScore <= 134)) {nPoint=8;}
//if (nScore > 134) {nPoint = 10;}
// difficult score ranges (easy score +75)
//if (nScore <= 0) {nPoint=0;}
//if ((nScore > 0) && (nScore <= 100)) {nPoint=1;}
//if ((nScore > 100) && (nScore <= 125)) {nPoint=2;}
//if ((nScore > 125) && (nScore <= 145)) {nPoint=4;}
//if ((nScore > 145) && (nScore <= 165)) {nPoint=6;}
//if ((nScore > 165) && (nScore <= 174)) {nPoint=8;}
//if (nScore > 174) {nPoint = 10;}
int nTotalScore = GetLocalInt(oTarget,"total") + nPoint;
SetLocalInt(oTarget,"total",nTotalScore);
}