View unanswered posts | View active topics * FAQ    * Search
* Login 




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Krivoklat
 
PostPosted: Wed, Dec 30 2015, 12:55 PM 

User avatar

Player

Joined: 22 Dec 2015

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);
}

_________________
Where you came from is gone,
where you thought you were goin' to, weren’t never there,
and where you are ain’t no good unless you can get away from it.


 
      
Krivoklat
 
PostPosted: Wed, Dec 30 2015, 13:55 PM 

User avatar

Player

Joined: 22 Dec 2015

Extreme Example:

Level 30 multi-class PC
Fighter(9)Wizard(1)AA(20)
With Epic Weap. Focus + Epic Specialize + Imp Crit

Working through the script on the easy target:

1d100 + Following Bonuses:

+5 Weapon Proficiency in Bows
+10 Weapon Focus in Bows
+10 Weapon Specialization in Bows
+10 Improved Critical in Bows
+10 Epic Focus in Bows
+10 Epic Specialization in Bows
+BASE ATTACK BONUS
+1 per Enchant Arrow Feat (AA Prestige Class)

1d100+5+10+10+10+10+10+29+10

will generate a score of 95-195

This is the absolute best possible Archer for this script (since it only allows levels of AA)


Apply this to the easy-target criteria:

1-25 = 1 point
26-50 = 2 points
51-70 = 3 points
71-90 = 4 points
90-100 = BULLS EYE!!

With a minimum of 95 score, you will get bullseye every shot on the EASY target!
(yeah, big deal. this is the EASY target.)


-------------------

Example: a level 30 Fighter(9)Wizard(1)AA(20)
With Epic Weap. focus + Specialize, and Imp Crit

Working through the script on the HARD target!

1d100+5+10+10+10+10+10+29+10

generates a score range of 141-165

HARD-target score criteria (Easy Target +75)

1-100 = 1 point
101-125 = 2 points
126-145 = 3 points
146-165 = 4 points
166-175 = BULLS EYE!!

SO! not so easy, eh 20-lvl AA??

Our lvl 30 PC with 20 Arcane Archer can possibly score a 141 on an epic fail (i.e. d100 roll of 1 +140 bonus)... *facepalm*
which for scoring purposes would grant the archer 3 measly points... might as well be a complete miss amiright archers?? ;)
we would expect a LOT of Bulls eye's.. BUT the occasional MISS will happen.. *cue jeers from onlookers*
and two epic lvl 30's w/ 20 levels of AA ~can~ duke it out to see which is best..

and due to the Randomness of the competition, the same person won't win every time, so "rematches" are always a possibility!

Best of all, the exact same level of competition could be had between two level 3 rangers, and a true archery competition could RP'ed with tiered entry for great fun for PC's of all levels!

_________________
Where you came from is gone,
where you thought you were goin' to, weren’t never there,
and where you are ain’t no good unless you can get away from it.


 
      
Xenos
 
PostPosted: Sun, Jan 03 2016, 18:16 PM 

User avatar

Player

Joined: 03 Jan 2007

This is a pretty cool idea! Just wanted to comment to support it.

In the past when we did these kinds of events, we would make an effort to break people into tiers. Proficient, Skilled, Master. The important thing to remember is we're trying to have fun, and doing the best we can with what we have. So despite how fair/unfair any given system is, roll with it and suspend one's disbelief long enough to play it out.

What i've never really worked out was a good mage duel system.. i mean, besides having them actually duel. Archers don't compete by shooting each other in the face like it's a western after all. Warrior types could in theory just fight, but it feels wrong it make it just about AB/AC so i dunno. Hm.. with a more intimate knowledge of swordplay, one might be able to sort of narrate a fight for two players, letting them call out their respective attacks to the narrators, who then lets the other fighter know what he might see. Or.. the easy answer, is for people to have Parry. We would still play it out by hand, but it could be more like fencing.

_________________
Image

House Auvrea'Kan Crafts and Services is now open and prepared to discuss orders.


 
      
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group