Battledale_PRC8/_module/nss/jw_gobboalch_use.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

87 lines
1.8 KiB
Plaintext

void Makemeat (int nTotal, object oPC, object oTroll, object oBlood);
void main()
{
object oMeat;
object oPC;
int nIntbonus;
int nRoll;
int nTotal;
int nBlood=0;
int nMeat=0;
object oInv;
object oBlood;
object oTroll;
oPC=GetLastDisturbed();
oInv=GetFirstItemInInventory();
while (GetIsObjectValid(oInv))
{
if (GetTag(oInv)=="jw_troll_meat")
{ nMeat=1;
oTroll=oInv;
}
if (GetTag(oInv)=="jw_panther_bl")
{ nBlood=1;
oBlood=oInv;
}
oInv=GetNextItemInInventory();
}
if (nMeat==1&&nBlood==1)
{
AssignCommand(oPC,SetFacingPoint(GetPosition(OBJECT_SELF)));
AssignCommand(oPC,PlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,5.0));
AssignCommand(oPC,FloatingTextStringOnCreature("Brewing",oPC));
PlaySound("al_mg_cauldron1");
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_COM_CHUNK_BONE_MEDIUM),GetLocation(OBJECT_SELF),6.0);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_NATURE),GetLocation(OBJECT_SELF),6.0);
nIntbonus=GetAbilityModifier(ABILITY_INTELLIGENCE,oPC)+GetSkillRank(SKILL_LORE,oPC);
nRoll=d20(1);
nTotal=nRoll+nIntbonus;
DelayCommand(3.0,SendMessageToPC(oPC,"Rolled "+IntToString(nRoll)+" + lore and intelligence bonus "+IntToString(nIntbonus)+" = "+IntToString(nTotal)+" vs minimum DC 14"));
DelayCommand(3.0,Makemeat ( nTotal, oPC, oTroll, oBlood));
}
}
void Makemeat (int nTotal, object oPC, object oTroll, object oBlood)
{
if (nTotal<14)
{
SendMessageToPC(oPC,"The ingredients are ruined");
DestroyObject(oTroll);
DestroyObject(oBlood);
SetLocalInt(oPC,"cooking",0);
return;
}
SendMessageToPC(oPC,"You create five vials of sickly red potion.");
DestroyObject(oTroll);
DestroyObject(oBlood);
CreateItemOnObject("jw_panther_potio",oPC,5);
return;
}