Player Resource Consortium

 

Author Topic: Changing Heal spell for server  (Read 10557 times)

0 Members and 1 Guest are viewing this topic.

October 15, 2010, 08:58:40 AM
  • Adept
  • *
  • Posts: 37
  • Karma: +0/-0
    • View Profile
    • www.altharianrenegade.com

I would llike to increase the Heal spell as run a uber server, where abouts would I exactly change this within the prc? I have been looking for ages but seem unable to find it, if anyone can tell me file to alter I would appreciate it.
Would I have to provide a hak for players if I was to do this? And is there a suggested method for doing this if so what is it etc.

Thanks in advance.


October 15, 2010, 09:08:44 AM
Reply #1
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

Quote from: Moixa

I would llike to increase the Heal spell as run a uber server, where abouts would I exactly change this within the prc? I have been looking for ages but seem unable to find it, if anyone can tell me file to alter I would appreciate it.
Would I have to provide a hak for players if I was to do this? And is there a suggested method for doing this if so what is it etc.

Thanks in advance.


You mean increase the amount of damage healed? You need to edit nw_s0_healharm.nss script (in prc_spells.hak), change the nCap int (for both Heal and Mass Heal spells) and compile the script. Than you need to place the compiled file (*.nsc) in a hak above prc_spells.hak - preferably a top hak for your server if you have any, but players don't need that file so if you place it in prc_2das.hak it should work as well.

You know that you can use switches to revert to BioWare Heal (that healed to max hp), right?


October 15, 2010, 09:12:21 AM
Reply #2
  • Adept
  • *
  • Posts: 37
  • Karma: +0/-0
    • View Profile
    • www.altharianrenegade.com

I tried the bioware thing it not work, could you please explain so I can check I not miss anything?

PRC_BIOWARE_HEAL int 1?
« Last Edit: October 15, 2010, 09:13:09 AM by Moixa »


October 15, 2010, 09:16:40 AM
Reply #3
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

Quote from: Moixa

I tried the bioware thing it not work, could you please explain so I can check I not miss anything?

PRC_BIOWARE_HEAL int 1?


Yes, that's the one. But it will heal 10*caster level hps (no cap). My bad, sorry.


October 15, 2010, 11:53:54 AM
Reply #4
  • Adept
  • *
  • Posts: 37
  • Karma: +0/-0
    • View Profile
    • www.altharianrenegade.com

I am having trouble making or finding the .ncs file, it is not showing up in my temp folder? only the .nss file.  I tried using the nss file in a hak but nothing happened :(


October 15, 2010, 09:25:37 PM
Reply #5

You edit the .nss file. Save the module, then built it so it compiles all your scripts. Assuming the 3.4 has the changes letting you compile script via the toolset. That will output an .ncs file for the script. The .ncs file is what the game executes, the .nss file it used to create the .ncs file which the game understands.
« Last Edit: October 15, 2010, 09:27:37 PM by KenquinnTheInsaneOne »


October 22, 2010, 06:40:09 AM
Reply #6
  • Adept
  • *
  • Posts: 37
  • Karma: +0/-0
    • View Profile
    • www.altharianrenegade.com

For some reason I cannot get it to compile, I tried various methods and cannot get a .ncs file.

Could one of you try see if you can make for me please?  I have spent ages trying and just cannot figure it out :(

Code: [Select]
/*
    nw_s0_healharm

    Heal/Harm in the one script

    By: Flaming_Sword
    Created: Jun 14, 2006
    Modified: Nov 21, 2006

    Consolidation of heal/harm scripts
    Mass Heal vfx on target looks like heal
    added greater harm, mass harm
*/

#include "prc_sp_func"
#include "prc_inc_sp_tch"
#include "prc_inc_function"
#include "prc_add_spell_dc"
#include "inc_dispel"

//Implements the spell impact, put code here
//  if called in many places, return TRUE if
//  stored charges should be decreased
//  eg. touch attack hits
//
//  Variables passed may be changed if necessary
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent, int bIsHeal)
{
    int nSpellID = PRCGetSpellId();
    int nMetaMagic = PRCGetMetaMagicFeat();
    int nHealVFX, nHurtVFX, nEnergyType, nDice, iBlastFaith, nHeal;
    float fRadius;
    string nSwitch;
    int nCap = 1400;
    if(bIsHeal)
    {
        nHealVFX = VFX_IMP_HEALING_X;
        nHurtVFX = VFX_IMP_SUNSTRIKE;
        nEnergyType = DAMAGE_TYPE_POSITIVE;
        nSwitch = PRC_BIOWARE_HEAL;
        fRadius = RADIUS_SIZE_COLOSSAL;
        if(nSpellID == SPELL_MASS_HEAL)
        {
            nSwitch = PRC_BIOWARE_MASS_HEAL;
            nCap = 1500;
        }
    }
    else
    {
        nHealVFX = VFX_IMP_HEALING_G;
        nHurtVFX = 246;
        nEnergyType = DAMAGE_TYPE_NEGATIVE;
        nSwitch = PRC_BIOWARE_HARM;
        fRadius = RADIUS_SIZE_HUGE;
    }
    int iHeal;
    int iAttackRoll = 1;
    if((nSpellID == SPELL_MASS_HARM) || (nSpellID == SPELL_GREATER_HARM))
    {
        nDice = (nCasterLevel > 20) ? 20 : nCasterLevel;
        nHeal = d12(nDice);
        if((nMetaMagic & METAMAGIC_MAXIMIZE) || BlastInfidelOrFaithHeal(oCaster, oTarget, nEnergyType, TRUE))
            nHeal = 12 * nDice; //in case higher level spell slots are available
    }
    else
    {
        nHeal = 10 * nCasterLevel;
    }
    if(nHeal > nCap && !GetPRCSwitch(nSwitch))
        nHeal = nCap;
    int bMass = IsMassHealHarm(nSpellID);
    location lLoc;
    if(bMass)
    {
        lLoc = (nSpellID == SPELL_MASS_HARM) ? GetLocation(oCaster) : PRCGetSpellTargetLocation();
        oTarget = MyFirstObjectInShape(SHAPE_SPHERE, fRadius, lLoc);
        ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(bIsHeal ? VFX_FNF_LOS_HOLY_30 : VFX_FNF_LOS_EVIL_20), lLoc);
    }
    float fDelay = 0.0;
    while(GetIsObjectValid(oTarget))
    {
        if(bMass) fDelay = PRCGetRandomDelay();
        iHeal = GetObjectType(oTarget) == OBJECT_TYPE_CREATURE &&
                ((!bIsHeal && MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) ||
                (bIsHeal && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD));
        if(iHeal && (spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, oCaster) || (GetIsDead(oTarget) && (GetCurrentHitPoints(oTarget) > -10))))
        {
            SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID, FALSE));

            //Warforged are only healed for half, none if they have Improved Fortification
            if(GetRacialType(oTarget) == RACIAL_TYPE_WARFORGED) nHeal /= 2;
            if(GetHasFeat(FEAT_IMPROVED_FORTIFICATION, oTarget)) nHeal = 0;


            DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nHeal), oTarget));
            DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nHealVFX), oTarget));
            // Code for FB to remove damage that would be caused at end of Frenzy
            SetLocalInt(oTarget, "PC_Damage", 0);
        }
        else if((GetObjectType(oTarget) != OBJECT_TYPE_CREATURE && !bIsHeal) ||
                (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE && !iHeal))
        {
            if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oCaster)
            {
                SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID));
                iAttackRoll = PRCDoMeleeTouchAttack(oTarget);
                if (iAttackRoll)
                {
                    if (!PRCDoResistSpell(oCaster, oTarget, nCasterLevel + SPGetPenetr()))
                    {
                        int nModify = d4();
                        iBlastFaith = BlastInfidelOrFaithHeal(oCaster, oTarget, nEnergyType, TRUE);
                        if((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith)
                        {
                            nModify = 1;
                        }
                        if((nSpellID == SPELL_MASS_HARM) || (nSpellID == SPELL_GREATER_HARM))
                        {
                            nHeal = d12(nDice);
                            if((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith)
                                nHeal = 12 * nDice;
                        }
                        else
                        {
                            nHeal = 10 * nCasterLevel;
                        }
                        if(nHeal > nCap && !GetPRCSwitch(nSwitch))
                            nHeal = nCap;

                        if(PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF)))
                        {
                            nHeal /= 2;
                            if (GetHasMettle(oTarget, SAVING_THROW_WILL)) // Ignores partial effects
                                nHeal = 0;
                        }
                        int nHP = GetCurrentHitPoints(oTarget);
                        if (nHeal > nHP - nModify)
                            nHeal = nHP - nModify;
                        DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nHeal, nEnergyType), oTarget));
                        DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nHurtVFX), oTarget));
                    }
                }
            }
        }
        if(!bMass) break;
        oTarget = MyNextObjectInShape(SHAPE_SPHERE, fRadius, lLoc);
    }
    //Spell Removal Check
    SpellRemovalCheck(OBJECT_SELF, oTarget);
    return iAttackRoll;    //return TRUE if spell charges should be decremented
}

void main()
{
    if (DEBUG) DoDebug("nw_s0_healharm running "+IntToString(GetIsPC(OBJECT_SELF)));
    object oCaster = OBJECT_SELF;
    int nCasterLevel = PRCGetCasterLevel(oCaster);
    int nSpellID = PRCGetSpellId();
    int bIsHeal = IsHeal(nSpellID);  //whether it is a heal or harm spell
    PRCSetSchool(GetSpellSchool(nSpellID));
    if (!X2PreSpellCastCode()) return;
    if (DEBUG) DoDebug("nw_s0_healharm running "+IntToString(GetIsPC(OBJECT_SELF)));
    object oTarget = PRCGetSpellTargetObject();
    int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
    if(!nEvent) //normal cast
    {
        if (DEBUG )DoDebug("nw_s0_healharm running normal casting");
        if(IsTouchSpell(nSpellID) && GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
        {   //holding the charge, casting spell on self
            SetLocalSpellVariables(oCaster, 1);   //change 1 to number of charges
            if (DEBUG) DoDebug("nw_s0_healharm running returning");
            return;
        }
        if (DEBUG) DoDebug("nw_s0_healharm running DoSpell");
        DoSpell(oCaster, oTarget, nCasterLevel, nEvent, bIsHeal);
    }
    else
    {
        if (DEBUG) DoDebug("nw_s0_healharm running else casting");
        if(nEvent & PRC_SPELL_EVENT_ATTACK)
        {
            if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent, bIsHeal))
                DecrementSpellCharges(oCaster);
        }
    }
    PRCSetSchool();
}


October 22, 2010, 02:44:18 PM
Reply #7

I went and used the PRC compiler to compile the script for you. You can't use the Bioware compiler to compile some of the PRC scripts(Just found out the fixes to the circular reference was mainly so you can compile your own scripts with the toolset.)
« Last Edit: October 22, 2010, 03:54:54 PM by KenquinnTheInsaneOne »