StrangeJ Posted March 28, 2005 Share Posted March 28, 2005 How would you heal the whole party from a script? I looked at the force heal script, but couldn't get my head round it (haven't been scripting for more than a day ) Also I guess it would be relative, while I need to heal the party fully... Link to comment Share on other sites More sharing options...
Xcom Posted March 28, 2005 Share Posted March 28, 2005 something like this maybe: void main() { int i; object oPartyMember; for (i = 0; i<3;i++) { oPartyMember = GetPartyMemberByIndex(i); if ( GetIsObjectValid(oPartyMember)) { ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oPartyMember)),oPartyMember); } } } Originally posted by StrangeJ Also I guess it would be relative, while I need to heal the party fully... Uh.. what do you mean? Link to comment Share on other sites More sharing options...
StrangeJ Posted March 28, 2005 Author Share Posted March 28, 2005 I meant, by relative, it would e.g +10 instead of setting it to 10... Thanks, I'll try later (at the moment pc is going so s l o w ) Edit: How would I change this line (from above) to give max force? ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oPartyMember)),oPartyMember); Link to comment Share on other sites More sharing options...
Xcom Posted March 28, 2005 Share Posted March 28, 2005 Originally posted by StrangeJ I change this line (from above) to give max force? like this: ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHealForcePoints(GetMaxForcePoints( oPartyMember)), oPartyMember); (btw.. it's one line text. ) Edit tk102: Xcom, if you put spaces after paranthesis and commas, then these forums won't be as likely to linebreak your code in mid-word. That's a trick that took me awhile to realize. Also using the [ size=1] tag can help. Link to comment Share on other sites More sharing options...
StrangeJ Posted March 28, 2005 Author Share Posted March 28, 2005 Thanks Link to comment Share on other sites More sharing options...
Xcom Posted March 28, 2005 Share Posted March 28, 2005 You're welcome. Edit tk102: Xcom, if you put spaces after paranthesis and commas, then these forums won't be as likely to linebreak your code in mid-word. That's a trick that took me awhile to realize. Also using the [ size=1] tag can help. Ah! Good to know. Thanks for the info, tk. Link to comment Share on other sites More sharing options...
Keiko Posted March 30, 2005 Share Posted March 30, 2005 I think this should work also: // a_healparty // This script heals everyone in the current party. void main() { object obj = GetFirstPC(); while( GetIsObjectValid( obj ) ) { ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(obj) - GetCurrentHitPoints(obj)),obj); obj = GetNextPC(); } } Darthy Link to comment Share on other sites More sharing options...
Ellderon Posted March 30, 2005 Share Posted March 30, 2005 Can I ask something? Is it possible to make a frce power that would heal all non-hostiles in your vicinity? Like for instance in the mandalorian camp - that battle with the Sith asasins. A power that would heal any party member or mandalorian in a given radius. Link to comment Share on other sites More sharing options...
stoffe Posted March 30, 2005 Share Posted March 30, 2005 Originally posted by Ellderon Can I ask something? Is it possible to make a frce power that would heal all non-hostiles in your vicinity? Like for instance in the mandalorian camp - that battle with the Sith asasins. A power that would heal any party member or mandalorian in a given radius. I believe a script like this should do the trick if attached to a force power in spells.2da. It will heal all non-hostiles within a 30m radius. // ST: st_healnoenemies.nss // ---------------------------------------------------------- // ST: Heal all non-hostiles within selection range (30 m). // Amount to heal is equal to half of the force user's // level plus cha/wis modifiers plus Treat Injury skill. // ---------------------------------------------------------- void main() { int nDiff; int nHealAmount = GetHitDice(OBJECT_SELF) / 2; nHealAmount += GetAbilityModifier(ABILITY_WISDOM); nHealAmount += GetAbilityModifier(ABILITY_CHARISMA); nHealAmount += GetSkillRank(SKILL_TREAT_INJURY, OBJECT_SELF); location lLoc = GetLocation(OBJECT_SELF); effect eHeal; effect eVis = EffectVisualEffect(VFX_IMP_HEAL); object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 30.0, lLoc, FALSE, OBJECT_TYPE_CREATURE); while (GetIsObjectValid(oTarget)) { if (!GetIsEnemy(oTarget) && (GetRacialType(oTarget) != RACIAL_TYPE_DROID)) { nDiff = GetMaxHitPoints(oTarget) - GetCurrentHitPoints(oTarget); if (nDiff > 0) { eHeal = EffectHeal((nHealAmount > nDiff ? nDiff : nHealAmount)); SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget); ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); } } oTarget = GetNextObjectInShape(SHAPE_SPHERE, 30.0, lLoc, FALSE, OBJECT_TYPE_CREATURE); } } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.