39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
// fireseed_slam - OnHitScript for fireseed_slam
|
|
void main()
|
|
{
|
|
object oMe=GetItemActivator();
|
|
object oTarget=GetItemActivatedTarget();
|
|
effect eDmg;
|
|
string sRes=GetResRef(oMe);
|
|
effect eVFX=EffectVisualEffect(VFX_IMP_FLAME_S);
|
|
int nDmg=d4();
|
|
int nGrow;
|
|
object oMother=GetLocalObject(oMe,"oMother");
|
|
object oNew;
|
|
int nNum=GetLocalInt(oMe,"nNum");
|
|
SendMessageToPC(GetFirstPC(),GetName(oMe)+" hits "+GetName(oTarget)+" with fire slam.");
|
|
if (sRes=="firespawn")
|
|
{
|
|
eVFX=EffectVisualEffect(VFX_IMP_FLAME_M);
|
|
nDmg=d8();
|
|
}
|
|
eDmg=EffectDamage(nDmg,DAMAGE_TYPE_FIRE);
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVFX,oTarget,1.0);
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,oTarget,1.0);
|
|
if (sRes!="firespawn")
|
|
{ // check for growth
|
|
nGrow=GetLocalInt(oMe,"nGrow");
|
|
nGrow=nGrow+nDmg;
|
|
SetLocalInt(oMe,"nGrow",nGrow);
|
|
if (nGrow>=12)
|
|
{ // become firespawn
|
|
oNew=CreateObject(OBJECT_TYPE_CREATURE,"firespawn",GetLocation(oMe));
|
|
SetLocalObject(oNew,"oMother",oMother);
|
|
SetLocalInt(oNew,"nNum",nNum);
|
|
if (nNum==1) SetLocalObject(oMother,"oChild1",oNew);
|
|
else { SetLocalObject(oMother,"oChild2",oNew); }
|
|
DelayCommand(0.5,DestroyObject(oMe));
|
|
} // become firespawn
|
|
} // check for growth
|
|
}
|