Battledale_PRC8/_module/nss/nk_gn_woodfire.nss
Jaysyn904 7b9e44ebbb Initial upload
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.
2024-03-11 23:44:08 -04:00

46 lines
1.6 KiB
Plaintext

void main()
{
effect eVis = EffectVisualEffect(VFX_DUR_LIGHT_YELLOW_15);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eLink = EffectLinkEffects(eVis, eDur);
object oPC = GetPCSpeaker();
location loc = GetLocation(oPC);
int nInt = GetAbilityModifier(ABILITY_DEXTERITY, oPC);
int nLore = GetSkillRank(SKILL_LORE, oPC);
int nRoll=d20(1);
int nTotal = nInt + nLore + nRoll;
int nExtra = nInt+nLore;
if (nExtra>0)
{
nExtra=nExtra*20;
}
else
{
nExtra=1;
}
float fExtra=IntToFloat(nExtra);
AssignCommand(oPC,PlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0,5.0));
AssignCommand(oPC,FloatingTextStringOnCreature("starts a campfire",oPC));
SendMessageToPC(oPC,"Rolled "+IntToString(nRoll)+" + lore and dex bonus = "+IntToString(nTotal)+" vs minimum DC 10");
//AssignCommand(oPC,PlaySound("al_cv_firecamp1"));
if (nTotal > 10)
{
CreateObject(OBJECT_TYPE_PLACEABLE , "nk_gn_campfire", loc, TRUE);
object oFire = GetNearestObjectByTag("nk_gn_campfire" , oPC, 1);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oFire);
PlaySound("al_cv_firecamp1");
DelayCommand(200.0+fExtra,DestroyObject(oFire));
object oWood = GetItemPossessedBy(oPC, "jw_logs");
DestroyObject(oWood);
}
else
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(1, DAMAGE_TYPE_FIRE, DAMAGE_POWER_ENERGY), oPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_HIT_FIRE, FALSE), oPC);
AssignCommand(oPC, ActionSpeakString("*burns fingers*", TALKVOLUME_TALK));
}
}