Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
63 lines
1.7 KiB
Plaintext
63 lines
1.7 KiB
Plaintext
|
|
void main()
|
|
{
|
|
object oSelf = OBJECT_SELF;
|
|
object oAttacker = GetLastHostileActor(oSelf); //The last person to act hostilely, attacker, dammagers, spellcaster (if hostile), or disturber(in case of pickpocketing)
|
|
int iDexMod = GetAbilityModifier(ABILITY_DEXTERITY, oAttacker);
|
|
int nBowFocus;
|
|
int nCalledShot;
|
|
string nPCname = GetPCPlayerName(oSelf);
|
|
|
|
|
|
|
|
{
|
|
// Apply bonuses for beneficial feats
|
|
if (GetHasFeat(FEAT_WEAPON_FOCUS_LONGBOW, oAttacker))
|
|
nBowFocus = 1;
|
|
}
|
|
{
|
|
if (GetHasFeat(FEAT_WEAPON_FOCUS_SHORTBOW, oAttacker))
|
|
nBowFocus = 1;
|
|
}
|
|
{
|
|
if (GetHasFeat(FEAT_CALLED_SHOT, oAttacker))
|
|
nCalledShot = 1;
|
|
}
|
|
|
|
int iHitCalc = d20()+iDexMod+nCalledShot+nBowFocus;
|
|
int iRandomChance = d20();
|
|
|
|
if (iRandomChance == 20)
|
|
{
|
|
ActionSpeakString ("Contestant makes a lucky shot! Centre Ring (5 Points)");
|
|
return;
|
|
}
|
|
else if (iRandomChance == 1)
|
|
{
|
|
ActionSpeakString ("Scoring shot made on target edge (1 Point)");
|
|
return;
|
|
|
|
}
|
|
else if (iHitCalc <= 5)
|
|
{
|
|
ActionSpeakString ("Scoring shot made on target edge (1 Point)");
|
|
return;
|
|
}
|
|
else if (iHitCalc <= 12)
|
|
{
|
|
ActionSpeakString ("BLUE: Scoring shot made on outer circle (3 Points)");
|
|
return;
|
|
}
|
|
else if (iHitCalc <= 19)
|
|
{
|
|
ActionSpeakString ("WHITE: Scoring shot made on inner circle (4 Points)");
|
|
return;
|
|
}
|
|
else if (iHitCalc <= 30)
|
|
{
|
|
ActionSpeakString ("RED: Scoring shot made on centre circle! (5 Points)");
|
|
return;
|
|
}
|
|
}
|
|
|