Try something like this.
void DealDamage( float fInterval, int nDamgPer, int nTotalDamage)
{
SendMessageToPC(OBJECT_SELF, "Deal "+IntToString(nDamgPer) +" points of damage");
/** Place effect to damage OBJECT_SELF here. **/
nTotalDamage -= nDamgPer;
if ( nTotalDamage >0 )
{
DelayCommand(fInterval, DealDamage( fInterval, nDamgPer, nTotalDamage));
SpeakString( IntToString( nTotalDamage) +" Points left to deal");
}
else SpeakString( "Damage Finished") ;
}
void castcard152(object oPC, int addToSwampPool)
{
SendMessageToPC(oPC, "card152 triggered...next should be the damage " + IntToString(addToSwampPool));
AssignCommand(oPC, DealDamage( 10.0, 2, 200)) ;
}
Edit: It is really not good to place 100 delayed commands on a target all at once.
EDIT2: OOps forgot to assign the function to the PC. Fixed.
Modifié par Lightfoot8, 17 octobre 2012 - 11:23 .