Kovâná Ẑelezný Posted September 6, 2008 Share Posted September 6, 2008 Does anyone know a script that will damage the PC who sets off the effect. So far I have effect nDam=EffectDamage(100,SWFP_DAMAGE_TYPE); Would it be right if I used this afterwards? ApplyEffectToObject(DURATION_TYPE_TEMPORARY,nDam,GetFirstPC(),2.0); Or should I use this? ApplyEffectToObject(DURATION_TYPE_TEMPORARY,nDam,OBJECT_SELF,2.0); I'm not sure when which applies to which style. I know they mean the same basic thing. It there a general rule to which way it is coded? Thanks! Link to comment Share on other sites More sharing options...
Tupac Amaru Posted September 8, 2008 Share Posted September 8, 2008 The two lines target different objects. The first one with GetFirstPC() will always damage the player. OBJECT_SELF will damage the object who is running the script which is what you want, I think. Also, a damage effect can't be a temporary effect. DURATION_TYPE_INSTANT would fit better. If you want the damage to go away after a while as your script indicates then you can apply a delayed heal effect. effect nDam=EffectDamage(100,SWFP_DAMAGE_TYPE); ApplyEffectToObject(DURATION_TYPE_INSTANT, nDam, OBJECT_SELF); DelayCommand(2.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(100), OBJECT_SELF)); Link to comment Share on other sites More sharing options...
Kovâná Ẑelezný Posted September 8, 2008 Author Share Posted September 8, 2008 Ok, I get it now. Just getting the hang of this new syntax. Thanks. But I have 1 question... Why is there an EffectHeal(100) ? is it ment to be there or does it take the EffectDamage and apply it to the OBJECT_SELF? Link to comment Share on other sites More sharing options...
tk102 Posted September 8, 2008 Share Posted September 8, 2008 That was an example of how to apply a delayed healing effect, which would occur after 2 seconds. Another way to write the script to see the parallel between the damaging and the healing: effect nDam=EffectDamage(100,SWFP_DAMAGE_TYPE); ApplyEffectToObject(DURATION_TYPE_INSTANT, nDam, OBJECT_SELF); effect nHeal=EffectHeal(100); DelayCommand(2.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, nHeal, OBJECT_SELF)); Link to comment Share on other sites More sharing options...
Kovâná Ẑelezný Posted September 8, 2008 Author Share Posted September 8, 2008 So what you are saying is that..: effect nDam=EffectDamage(100,SWFP_DAMAGE_TYPE); ApplyEffectToObject(DURATION_TYPE_INSTANT, nDam, OBJECT_SELF); Should do the damage part..? And that..: effect nDam=EffectDamage(100,SWFP_DAMAGE_TYPE); ApplyEffectToObject(DURATION_TYPE_INSTANT, nDam, OBJECT_SELF); Should then heal it up 2 seconds after the damage came... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.