Funky
Modifié par FunkySwerve, 04 décembre 2010 - 09:11 .
Modifié par FunkySwerve, 04 décembre 2010 - 09:11 .
The problem with doing this is that you'd have to alter the scripts for every spell (and possibly spell-like ability) in the game, since spell resistance checks are basically hardcoded. Trust me, it's not a task to be taken lightly (I'm in the midst of rescripting every spell in my PW right now, and it's a big project).Vhaeraun Baenre wrote...
how about a script to make spell resistance % based instead of DC based like 2nd edition
Modifié par The Amethyst Dragon, 04 décembre 2010 - 09:14 .
// * Used to route the resist magic checks into this function to check for spell countering by SR, Globes or Mantles. // Return value if oCaster or oTarget is an invalid object: FALSE // Return value if spell cast is not a player spell: - 1 // Return value if spell resisted: 1 // Return value if spell resisted via magic immunity: 2 // Return value if spell resisted via spell absorption: 3 int MyResistSpell(object oCaster, object oTarget, float fDelay = 0.0)
int GetSpellResisted (struct SpellInfo si, object oTarget=OBJECT_INVALID, float fDelay=0.0, int bSROnly=FALSE) {
int nSR = 0, nResisted = 0, nRoll = 0;
if (!GetIsObjectValid(oTarget))
oTarget = si.target;
if (!GetIsObjectValid(oTarget))
return 0;
if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
nSR = GetSpellResistance(oTarget);
else
nSR = GetLocalInt(oTarget, "SR");
if (nSR > 0 && GetHasSpellImmunity(SPELL_SPELL_RESISTANCE, oTarget)) {
nSR -= GetLocalInt(oTarget, "TauntResult");
if (nSR < 1)
nSR = 1;
}
if (nSR > 0 && si.sp >= 0 && !GetFactionEqual(si.caster, oTarget)) {
nRoll = d20(1);
if (si.sp + nRoll < nSR)
nResisted = 1;
}
if (nResisted == 0) {
if (bSROnly) {
if (bSROnly == 2 && GetHasSpellImmunity(si.id, oTarget))
nResisted = 2;
} else {
switch (ResistSpell(si.caster, oTarget)) {
case 2: /* globe or spell immunity */
nResisted = 2;
break;
case 3: /* spell mantle */
if (si.sp >= 0)
nResisted = 3;
break;
}
}
}
if (!nResisted) {
if (nRoll > 0)
SendSpellResistanceMessage(si.caster, oTarget, nRoll, si.sp, nSR, fDelay);
return 0;
}
if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE) {
effect eVis;
switch (nResisted) {
case 2:
nSR = -2;
eVis = EffectVisualEffect(VFX_IMP_GLOBE_USE);
break;
case 3:
nSR = -3;
eVis = EffectVisualEffect(VFX_IMP_SPELL_MANTLE_USE);
break;
default:
eVis = EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE);
break;
}
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
if (nRoll > 0 || nSR < -1)
SendSpellResistanceMessage(si.caster, oTarget, nRoll, si.sp, nSR, fDelay);
return nResisted;
}
Modifié par FunkySwerve, 05 décembre 2010 - 03:10 .
Modifié par WebShaman, 05 décembre 2010 - 02:49 .
Actually, that's probably better still - it didn't occur to me because of my lingering bias against editing bioware includes, however outdated. The only issue I can see is that, without making any edits to the spells themselves, they'll use the default version, instead of compiling using the edited include. So, if you already have spell edits to all the scripts, this will work. Otherwise, you might as well do the mass edits.Avonos the Rogue wrote...
Would it be practice to edit the nw_i0_spells MyResistSpell() directly? You could probably even fudge a defaulting extra input on a number of spells that didn't use it if so.
#include "hg_inc"
#include "x2_inc_switches"
void DestroyFire (object oFire) {
SetPlotFlag(oFire, FALSE);
DestroyObject(oFire);
}
void DestroyTree (object oTree) {
SetPlotFlag(oTree, FALSE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, SupernaturalEffect(EffectDeath()), oTree);
DestroyObject(oTree, 0.5);
}
void SpawnFire (location lLoc) {
object oObj;
switch (Random(4)) {
case 0: oObj = CreateObject(OBJECT_TYPE_PLACEABLE, "ph_burningcanopy", lLoc); break;
case 1: oObj = CreateObject(OBJECT_TYPE_PLACEABLE, "ph_burningcanop2", lLoc); break;
case 2: oObj = CreateObject(OBJECT_TYPE_PLACEABLE, "ph_burningcanop3", lLoc); break;
case 3: oObj = CreateObject(OBJECT_TYPE_PLACEABLE, "ph_burningcanop4", lLoc); break;
}
DelayCommand(IntToFloat(10 + Random(20)), DestroyFire(oObj));
}
void SpawnBlaze (vector vVec) {
object oArea = GetArea(OBJECT_SELF);
vector vVecNew;
location lLoc;
int i, nFires = 2 + d4();
for (i = 0; i < nFires; i++) {
vVecNew = Vector(vVec.x + (Random(11) - 5), vVec.y + (Random(11) - 5), vVec.z + ((Random(11) - 5) / 10.0));
lLoc = Location(oArea, vVecNew, 0.0);
SpawnFire(lLoc);
}
}
void main() {
int nSpellId = GetSpellId();
float fRadius;
switch (nSpellId) {
case SPELL_FIREBALL: fRadius = 20.0; break;
case SPELL_FIRE_STORM: fRadius = 30.0; break;
case SPELL_FLAME_STRIKE: fRadius = 15.0; break;
default: return;
}
object oTarget = GetSpellTargetObject();
location lTarget = GetSpellTargetLocation();
if (GetIsObjectValid(oTarget))
lTarget = GetLocation(oTarget);
float fDelay, fMaxDist = fRadius / 2.0;
vector vTarget, vSpell = GetPositionFromLocation(lTarget);
for (oTarget = GetFirstObjectInShape(SHAPE_SPHERE, fRadius, lTarget, FALSE, OBJECT_TYPE_PLACEABLE);
GetIsObjectValid(oTarget);
oTarget = GetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget, FALSE, OBJECT_TYPE_PLACEABLE)) {
if (!GetPlotFlag(oTarget) || GetFortitudeSavingThrow(oTarget) < 80)
continue;
vTarget = GetPosition(oTarget);
if (fabs(vTarget.x - vSpell.x) > fMaxDist || fabs(vTarget.y - vSpell.y) > fMaxDist)
continue;
fDelay = 1.0 + (Random(20) / 10.0);
DelayCommand(fDelay, ApplyVisualAtLocation(VFX_FNF_FIREBALL, GetLocation(oTarget)));
DelayCommand(fDelay + 0.2, SpawnBlaze(vTarget));
DelayCommand(fDelay + 0.1, DestroyTree(oTarget));
}
}
You got one hand amputated?:innocent:Frith5 wrote...
1. The ability to interact with the nearest object specified by a chat command. ie PC walks up to a door, chats !open door, and then opens the door she's facing. I hate taking my hands off the keyboard.
This would be useful for targeting many things besides doors, of course. Such as !open chest, or !bash door, or !knock door, etc. Could use it to attack too. !kill Frith would target the object named Frith, if it exists and is in perception range, or in the area found to be right 'in front' of the calling object.
Bubba McThudd wrote...
How about a potion of "Full Manna" for mages that gives the effect of a full night's rest.
Modifié par jmlzemaggo, 14 décembre 2010 - 12:08 .
Modifié par eeriegeek, 14 décembre 2010 - 12:18 .