#include "nw_i0_2q4luskan"

void main()
{

object oPC = GetPCSpeaker();

SetLocalInt(oPC, "PteranodonsSpawned", 1);

int nDex = GetAbilityScore(oPC, ABILITY_DEXTERITY);
int nRoll = d20();

int nDam1 = d6();
int nDam2 = d6();
int nDam = (nDam1 + nDam2);

if (nRoll <= nDex) nDam = 0;

object oTarget = GetWaypointByTag("WP_AirKnock");
location lTarget = GetLocation(oTarget);
AssignCommand(oPC, ActionJumpToLocation(lTarget));

effect eDamage = EffectDamage(nDam, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL);
effect eKnock = EffectKnockdown();

DelayCommand(0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC));
DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eKnock, oPC, 15.0f));


location lWP1 = GetLocation(GetWaypointByTag("WP_Ptero1"));
location lWP2 = GetLocation(GetWaypointByTag("WP_Ptero2"));
location lWP3 = GetLocation(GetWaypointByTag("WP_Ptero3"));
DelayCommand(2.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "pteranodon", lWP1));
DelayCommand(2.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "pteranodon", lWP2));
DelayCommand(2.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "pteranodon", lWP3));

}

