63 lines
2.0 KiB
Plaintext
63 lines
2.0 KiB
Plaintext
#include "NW_I0_GENERIC"
|
|
// iSize:
|
|
// 1 = Large Dragon
|
|
// 2 = Huge Dragon
|
|
// 3 = Gargarntuan Dragon
|
|
// 4 = Colossal Dragon
|
|
void DragonTail(int iSize)
|
|
{
|
|
int iTailSlap = d12();
|
|
int iTailSweep = 0;
|
|
object oTarget = GetNearestSeenOrHeardEnemy();
|
|
switch (iSize) {
|
|
case 2: // huge
|
|
iTailSlap = d12(2);
|
|
break;
|
|
case 3: // gargantuan
|
|
iTailSlap = d8(2);
|
|
iTailSweep = d10(3);
|
|
break;
|
|
case 4: // colossal
|
|
iTailSlap = d10(3);
|
|
iTailSweep = d12(4);
|
|
break;
|
|
}
|
|
iTailSlap += GetAbilityModifier(ABILITY_STRENGTH)*3/2;
|
|
|
|
int iBAB = GetHitDice(OBJECT_SELF) + 8 - iSize;
|
|
int iToHit = GetAC(oTarget) - iBAB;
|
|
if (GetIsObjectValid(oTarget)) {
|
|
// TailSlap Attack
|
|
if (GetDistanceToObject(oTarget) < 7.0) {
|
|
iToHit += 5; // -5 to AR
|
|
int iRoll = d20();
|
|
if (GetIsPC(oTarget))
|
|
SendMessageToPC(oTarget, "Dragon tail slap attack -> Attack Roll (" +
|
|
IntToString(iRoll) + ") +"+ IntToString(iBAB) + " versus AC:" +
|
|
IntToString(GetAC(oTarget)));
|
|
|
|
// Tail Slap Hit?
|
|
if (iRoll >= iToHit)
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(iTailSlap, DAMAGE_TYPE_BLUDGEONING,
|
|
DAMAGE_POWER_PLUS_TWO), oTarget);
|
|
|
|
} // Close Enough?
|
|
//Tail Sweep Code... to be added
|
|
if (GetDistanceToObject(oTarget) < 7.0) {
|
|
int iRoll = d20();
|
|
if (iTailSweep >0) {
|
|
if (GetIsPC(oTarget))
|
|
SendMessageToPC(oTarget, "Dragon tail sweep attack -> Attack Roll (" +
|
|
IntToString(iRoll) + ")"+ IntToString(iBAB) + " versus AC:" +
|
|
IntToString(GetAC(oTarget)));
|
|
// Hit?
|
|
if (iRoll >= iToHit)
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(iTailSlap, DAMAGE_TYPE_BLUDGEONING,
|
|
DAMAGE_POWER_PLUS_TWO), oTarget);
|
|
} // TailSweep
|
|
} // Close Enough?
|
|
|
|
} // Valid Object
|
|
|
|
}
|