Initial commit

Initial commit
This commit is contained in:
Jaysyn904
2024-09-13 09:10:39 -04:00
parent 09dc8aec92
commit d1c309ae63
8437 changed files with 8727659 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,988 @@
//:://////////////////////////////////////////////
//:: FileName: "_plc_rsrch_ep_sp"
/* Purpose: This is the OnDisturbed event handler script for a placeable.
When an epic spell's book is placed into the inventory, it will search
and determine validity of the item, and then proceed with the proper
researching functions.
*/
//:://////////////////////////////////////////////
//:: Created By: Boneshank
//:: Last Updated On:
//:://////////////////////////////////////////////
#include "nw_i0_spells"
#include "inc_epicspells"
// This constant sets who may or may not research spells from the placeable
// this script is attached to. For example, if you only want arcane casters
// to be able to research from a lab, and not druids or clerics, you must
// determine the exclusivity for the placebale with this constant.
//
// You should save the script under a different name once constant is set....
//
// Keywords to use for this constant:
// For CLERICS ONLY ---- "CLERIC"
// For DRUIDS ONLY ---- "DRUID"
// For BOTH DRUIDS AND CLERICS ---- "DIVINE"
// For SORCERERS AND WIZARDS ONLY ---- "ARCANE"
// For EVERYONE ---- "ALL"
string WHO_CAN_RESEARCH = "ALL";
void main()
{
if (GetInventoryDisturbType() == INVENTORY_DISTURB_TYPE_ADDED)
{
object oBook = GetInventoryDisturbItem();
object oPC = GetLastDisturbed();
string sBook = GetTag(oBook);
int nDC, nIP, nFE, nR1, nR2, nR3, nR4, nvalid;
int nAllowed;
string sSc;
if (sBook == "A_STONE")
{
nDC = A_STONE_DC;
nIP = R_A_STONE_IP;
nFE = R_A_STONE_FE;
nR1 = A_STONE_R1;
nR2 = A_STONE_R2;
nR3 = A_STONE_R3;
nR4 = A_STONE_R4;
sSc = A_STONE_S;
nvalid = 1;
}
if (sBook == "ACHHEEL")
{
nDC = ACHHEEL_DC;
nIP = R_ACHHEEL_IP;
nFE = R_ACHHEEL_FE;
nR1 = ACHHEEL_R1;
nR2 = ACHHEEL_R2;
nR3 = ACHHEEL_R3;
nR4 = ACHHEEL_R4;
sSc = ACHHEEL_S;
nvalid = 1;
}
if (sBook == "AL_MART")
{
nDC = AL_MART_DC;
nIP = R_AL_MART_IP;
nFE = R_AL_MART_FE;
nR1 = AL_MART_R1;
nR2 = AL_MART_R2;
nR3 = AL_MART_R3;
nR4 = AL_MART_R4;
sSc = AL_MART_S;
nvalid = 1;
}
if (sBook == "ALLHOPE")
{
nDC = ALLHOPE_DC;
nIP = R_ALLHOPE_IP;
nFE = R_ALLHOPE_FE;
nR1 = ALLHOPE_R1;
nR2 = ALLHOPE_R2;
nR3 = ALLHOPE_R3;
nR4 = ALLHOPE_R4;
sSc = ALLHOPE_S;
nvalid = 1;
}
if (sBook == "ANARCHY")
{
nDC = ANARCHY_DC;
nIP = R_ANARCHY_IP;
nFE = R_ANARCHY_FE;
nR1 = ANARCHY_R1;
nR2 = ANARCHY_R2;
nR3 = ANARCHY_R3;
nR4 = ANARCHY_R4;
sSc = ANARCHY_S;
nvalid = 1;
}
if (sBook == "ANBLAST")
{
nDC = ANBLAST_DC;
nIP = R_ANBLAST_IP;
nFE = R_ANBLAST_FE;
nR1 = ANBLAST_R1;
nR2 = ANBLAST_R2;
nR3 = ANBLAST_R3;
nR4 = ANBLAST_R4;
sSc = ANBLAST_S;
nvalid = 1;
}
if (sBook == "ANBLIZZ")
{
nDC = ANBLIZZ_DC;
nIP = R_ANBLIZZ_IP;
nFE = R_ANBLIZZ_FE;
nR1 = ANBLIZZ_R1;
nR2 = ANBLIZZ_R2;
nR3 = ANBLIZZ_R3;
nR4 = ANBLIZZ_R4;
sSc = ANBLIZZ_S;
nvalid = 1;
}
if (sBook == "ARMY_UN")
{
nDC = ARMY_UN_DC;
nIP = R_ARMY_UN_IP;
nFE = R_ARMY_UN_FE;
nR1 = ARMY_UN_R1;
nR2 = ARMY_UN_R2;
nR3 = ARMY_UN_R3;
nR4 = ARMY_UN_R4;
sSc = ARMY_UN_S;
nvalid = 1;
}
if (sBook == "BATTLEB")
{
nDC = BATTLEB_DC;
nIP = R_BATTLEB_IP;
nFE = R_BATTLEB_FE;
nR1 = BATTLEB_R1;
nR2 = BATTLEB_R2;
nR3 = BATTLEB_R3;
nR4 = BATTLEB_R4;
sSc = BATTLEB_S;
nvalid = 1;
}
if (sBook == "CELCOUN")
{
nDC = CELCOUN_DC;
nIP = R_CELCOUN_IP;
nFE = R_CELCOUN_FE;
nR1 = CELCOUN_R1;
nR2 = CELCOUN_R2;
nR3 = CELCOUN_R3;
nR4 = CELCOUN_R4;
sSc = CELCOUN_S;
nvalid = 1;
}
if (sBook == "CHAMP_V")
{
nDC = CHAMP_V_DC;
nIP = R_CHAMP_V_IP;
nFE = R_CHAMP_V_FE;
nR1 = CHAMP_V_R1;
nR2 = CHAMP_V_R2;
nR3 = CHAMP_V_R3;
nR4 = CHAMP_V_R4;
sSc = CHAMP_V_S;
nvalid = 1;
}
if (sBook == "CON_RES")
{
nDC = CON_RES_DC;
nIP = R_CON_RES_IP;
nFE = R_CON_RES_FE;
nR1 = CON_RES_R1;
nR2 = CON_RES_R2;
nR3 = CON_RES_R3;
nR4 = CON_RES_R4;
sSc = CON_RES_S;
nvalid = 1;
}
if (sBook == "CON_REU")
{
nDC = CON_REU_DC;
nIP = R_CON_REU_IP;
nFE = R_CON_REU_FE;
nR1 = CON_REU_R1;
nR2 = CON_REU_R2;
nR3 = CON_REU_R3;
nR4 = CON_REU_R4;
sSc = CON_REU_S;
nvalid = 1;
}
if (sBook == "DEADEYE")
{
nDC = DEADEYE_DC;
nIP = R_DEADEYE_IP;
nFE = R_DEADEYE_FE;
nR1 = DEADEYE_R1;
nR2 = DEADEYE_R2;
nR3 = DEADEYE_R3;
nR4 = DEADEYE_R4;
sSc = DEADEYE_S;
nvalid = 1;
}
if (sBook == "DIREWIN")
{
nDC = DIREWIN_DC;
nIP = R_DIREWIN_IP;
nFE = R_DIREWIN_FE;
nR1 = DIREWIN_R1;
nR2 = DIREWIN_R2;
nR3 = DIREWIN_R3;
nR4 = DIREWIN_R4;
sSc = DIREWIN_S;
nvalid = 1;
}
if (sBook == "DREAMSC")
{
nDC = DREAMSC_DC;
nIP = R_DREAMSC_IP;
nFE = R_DREAMSC_FE;
nR1 = DREAMSC_R1;
nR2 = DREAMSC_R2;
nR3 = DREAMSC_R3;
nR4 = DREAMSC_R4;
sSc = DREAMSC_S;
nvalid = 1;
}
if (sBook == "DRG_KNI")
{
nDC = DRG_KNI_DC;
nIP = R_DRG_KNI_IP;
nFE = R_DRG_KNI_FE;
nR1 = DRG_KNI_R1;
nR2 = DRG_KNI_R2;
nR3 = DRG_KNI_R3;
nR4 = DRG_KNI_R4;
sSc = DRG_KNI_S;
nvalid = 1;
}
if (sBook == "DTHMARK")
{
nDC = DTHMARK_DC;
nIP = R_DTHMARK_IP;
nFE = R_DTHMARK_FE;
nR1 = DTHMARK_R1;
nR2 = DTHMARK_R2;
nR3 = DTHMARK_R3;
nR4 = DTHMARK_R4;
sSc = DTHMARK_S;
nvalid = 1;
}
if (sBook == "DULBLAD")
{
nDC = DULBLAD_DC;
nIP = R_DULBLAD_IP;
nFE = R_DULBLAD_FE;
nR1 = DULBLAD_R1;
nR2 = DULBLAD_R2;
nR3 = DULBLAD_R3;
nR4 = DULBLAD_R4;
sSc = DULBLAD_S;
nvalid = 1;
}
if (sBook == "DWEO_TH")
{
nDC = DWEO_TH_DC;
nIP = R_DWEO_TH_IP;
nFE = R_DWEO_TH_FE;
nR1 = DWEO_TH_R1;
nR2 = DWEO_TH_R2;
nR3 = DWEO_TH_R3;
nR4 = DWEO_TH_R4;
sSc = DWEO_TH_S;
nvalid = 1;
}
if (sBook == "ENSLAVE")
{
nDC = ENSLAVE_DC;
nIP = R_ENSLAVE_IP;
nFE = R_ENSLAVE_FE;
nR1 = ENSLAVE_R1;
nR2 = ENSLAVE_R2;
nR3 = ENSLAVE_R3;
nR4 = ENSLAVE_R4;
sSc = ENSLAVE_S;
nvalid = 1;
}
if (sBook == "EP_M_AR")
{
nDC = EP_M_AR_DC;
nIP = R_EP_M_AR_IP;
nFE = R_EP_M_AR_FE;
nR1 = EP_M_AR_R1;
nR2 = EP_M_AR_R2;
nR3 = EP_M_AR_R3;
nR4 = EP_M_AR_R4;
sSc = EP_M_AR_S;
nvalid = 1;
}
if (sBook == "EP_RPLS")
{
nDC = EP_RPLS_DC;
nIP = R_EP_RPLS_IP;
nFE = R_EP_RPLS_FE;
nR1 = EP_RPLS_R1;
nR2 = EP_RPLS_R2;
nR3 = EP_RPLS_R3;
nR4 = EP_RPLS_R4;
sSc = EP_RPLS_S;
nvalid = 1;
}
if (sBook == "EP_SP_R")
{
nDC = EP_SP_R_DC;
nIP = R_EP_SP_R_IP;
nFE = R_EP_SP_R_FE;
nR1 = EP_SP_R_R1;
nR2 = EP_SP_R_R2;
nR3 = EP_SP_R_R3;
nR4 = EP_SP_R_R4;
sSc = EP_SP_R_S;
nvalid = 1;
}
if (sBook == "EP_WARD")
{
nDC = EP_WARD_DC;
nIP = R_EP_WARD_IP;
nFE = R_EP_WARD_FE;
nR1 = EP_WARD_R1;
nR2 = EP_WARD_R2;
nR3 = EP_WARD_R3;
nR4 = EP_WARD_R4;
sSc = EP_WARD_S;
nvalid = 1;
}
if (sBook == "ET_FREE")
{
nDC = ET_FREE_DC;
nIP = R_ET_FREE_IP;
nFE = R_ET_FREE_FE;
nR1 = ET_FREE_R1;
nR2 = ET_FREE_R2;
nR3 = ET_FREE_R3;
nR4 = ET_FREE_R4;
sSc = ET_FREE_S;
nvalid = 1;
}
if (sBook == "FIEND_W")
{
nDC = FIEND_W_DC;
nIP = R_FIEND_W_IP;
nFE = R_FIEND_W_FE;
nR1 = FIEND_W_R1;
nR2 = FIEND_W_R2;
nR3 = FIEND_W_R3;
nR4 = FIEND_W_R4;
sSc = FIEND_W_S;
nvalid = 1;
}
if (sBook == "FLEETNS")
{
nDC = FLEETNS_DC;
nIP = R_FLEETNS_IP;
nFE = R_FLEETNS_FE;
nR1 = FLEETNS_R1;
nR2 = FLEETNS_R2;
nR3 = FLEETNS_R3;
nR4 = FLEETNS_R4;
sSc = FLEETNS_S;
nvalid = 1;
}
if (sBook == "GEMCAGE")
{
nDC = GEMCAGE_DC;
nIP = R_GEMCAGE_IP;
nFE = R_GEMCAGE_FE;
nR1 = GEMCAGE_R1;
nR2 = GEMCAGE_R2;
nR3 = GEMCAGE_R3;
nR4 = GEMCAGE_R4;
sSc = GEMCAGE_S;
nvalid = 1;
}
if (sBook == "GODSMIT")
{
nDC = GODSMIT_DC;
nIP = R_GODSMIT_IP;
nFE = R_GODSMIT_FE;
nR1 = GODSMIT_R1;
nR2 = GODSMIT_R2;
nR3 = GODSMIT_R3;
nR4 = GODSMIT_R4;
sSc = GODSMIT_S;
nvalid = 1;
}
if (sBook == "GR_RUIN")
{
nDC = GR_RUIN_DC;
nIP = R_GR_RUIN_IP;
nFE = R_GR_RUIN_FE;
nR1 = GR_RUIN_R1;
nR2 = GR_RUIN_R2;
nR3 = GR_RUIN_R3;
nR4 = GR_RUIN_R4;
sSc = GR_RUIN_S;
nvalid = 1;
}
if (sBook == "GR_SP_RE")
{
nDC = GR_SP_RE_DC;
nIP = R_GR_SP_RE_IP;
nFE = R_GR_SP_RE_FE;
nR1 = GR_SP_RE_R1;
nR2 = GR_SP_RE_R2;
nR3 = GR_SP_RE_R3;
nR4 = GR_SP_RE_R4;
sSc = GR_SP_RE_S;
nvalid = 1;
}
if (sBook == "GR_TIME")
{
nDC = GR_TIME_DC;
nIP = R_GR_TIME_IP;
nFE = R_GR_TIME_FE;
nR1 = GR_TIME_R1;
nR2 = GR_TIME_R2;
nR3 = GR_TIME_R3;
nR4 = GR_TIME_R4;
sSc = GR_TIME_S;
nvalid = 1;
}
if (sBook == "HELBALL")
{
nDC = HELBALL_DC;
nIP = R_HELBALL_IP;
nFE = R_HELBALL_FE;
nR1 = HELBALL_R1;
nR2 = HELBALL_R2;
nR3 = HELBALL_R3;
nR4 = HELBALL_R4;
sSc = HELBALL_S;
nvalid = 1;
}
if (sBook == "HELSEND")
{
nDC = HELSEND_DC;
nIP = R_HELSEND_IP;
nFE = R_HELSEND_FE;
nR1 = HELSEND_R1;
nR2 = HELSEND_R2;
nR3 = HELSEND_R3;
nR4 = HELSEND_R4;
sSc = HELSEND_S;
nvalid = 1;
}
if (sBook == "HERCALL")
{
nDC = HERCALL_DC - HERCEMP_DC; // The player only has to pay for upgrade
nIP = R_HERCALL_IP;
nFE = R_HERCALL_FE;
nR1 = HERCALL_R1;
nR2 = HERCALL_R2;
nR3 = HERCALL_R3;
nR4 = HERCALL_R4;
sSc = HERCALL_S;
nvalid = 1;
}
if (sBook == "HERCEMP")
{
nDC = HERCEMP_DC;
nIP = R_HERCEMP_IP;
nFE = R_HERCEMP_FE;
nR1 = HERCEMP_R1;
nR2 = HERCEMP_R2;
nR3 = HERCEMP_R3;
nR4 = HERCEMP_R4;
sSc = HERCEMP_S;
nvalid = 1;
}
if (sBook == "IMPENET")
{
nDC = IMPENET_DC;
nIP = R_IMPENET_IP;
nFE = R_IMPENET_FE;
nR1 = IMPENET_R1;
nR2 = IMPENET_R2;
nR3 = IMPENET_R3;
nR4 = IMPENET_R4;
sSc = IMPENET_S;
nvalid = 1;
}
if (sBook == "LEECH_F")
{
nDC = LEECH_F_DC;
nIP = R_LEECH_F_IP;
nFE = R_LEECH_F_FE;
nR1 = LEECH_F_R1;
nR2 = LEECH_F_R2;
nR3 = LEECH_F_R3;
nR4 = LEECH_F_R4;
sSc = LEECH_F_S;
nvalid = 1;
}
if (sBook == "LEG_ART")
{
nDC = LEG_ART_DC;
nIP = R_LEG_ART_IP;
nFE = R_LEG_ART_FE;
nR1 = LEG_ART_R1;
nR2 = LEG_ART_R2;
nR3 = LEG_ART_R3;
nR4 = LEG_ART_R4;
sSc = LEG_ART_S;
nvalid = 1;
}
if (sBook == "LIFE_FT")
{
nDC = LIFE_FT_DC;
nIP = R_LIFE_FT_IP;
nFE = R_LIFE_FT_FE;
nR1 = LIFE_FT_R1;
nR2 = LIFE_FT_R2;
nR3 = LIFE_FT_R3;
nR4 = LIFE_FT_R4;
sSc = LIFE_FT_S;
nvalid = 1;
}
if (sBook == "MAGMA_B")
{
nDC = MAGMA_B_DC;
nIP = R_MAGMA_B_IP;
nFE = R_MAGMA_B_FE;
nR1 = MAGMA_B_R1;
nR2 = MAGMA_B_R2;
nR3 = MAGMA_B_R3;
nR4 = MAGMA_B_R4;
sSc = MAGMA_B_S;
nvalid = 1;
}
if (sBook == "MASSPEN")
{
nDC = MASSPEN_DC;
nIP = R_MASSPEN_IP;
nFE = R_MASSPEN_FE;
nR1 = MASSPEN_R1;
nR2 = MASSPEN_R2;
nR3 = MASSPEN_R3;
nR4 = MASSPEN_R4;
sSc = MASSPEN_S;
nvalid = 1;
}
if (sBook == "MORI")
{
nDC = MORI_DC;
nIP = R_MORI_IP;
nFE = R_MORI_FE;
nR1 = MORI_R1;
nR2 = MORI_R2;
nR3 = MORI_R3;
nR4 = MORI_R4;
sSc = MORI_S;
nvalid = 1;
}
if (sBook == "MUMDUST")
{
nDC = MUMDUST_DC;
nIP = R_MUMDUST_IP;
nFE = R_MUMDUST_FE;
nR1 = MUMDUST_R1;
nR2 = MUMDUST_R2;
nR3 = MUMDUST_R3;
nR4 = MUMDUST_R4;
sSc = MUMDUST_S;
nvalid = 1;
}
if (sBook == "NAILSKY")
{
nDC = NAILSKY_DC;
nIP = R_NAILSKY_IP;
nFE = R_NAILSKY_FE;
nR1 = NAILSKY_R1;
nR2 = NAILSKY_R2;
nR3 = NAILSKY_R3;
nR4 = NAILSKY_R4;
sSc = NAILSKY_S;
nvalid = 1;
}
if (sBook == "NIGHTSU")
{
nDC = NIGHTSU_DC;
nIP = R_NIGHTSU_IP;
nFE = R_NIGHTSU_FE;
nR1 = NIGHTSU_R1;
nR2 = NIGHTSU_R2;
nR3 = NIGHTSU_R3;
nR4 = NIGHTSU_R4;
sSc = NIGHTSU_S;
nvalid = 1;
}
if (sBook == "ORDER_R")
{
nDC = ORDER_R_DC;
nIP = R_ORDER_R_IP;
nFE = R_ORDER_R_FE;
nR1 = ORDER_R_R1;
nR2 = ORDER_R_R2;
nR3 = ORDER_R_R3;
nR4 = ORDER_R_R4;
sSc = ORDER_R_S;
nvalid = 1;
}
if (sBook == "PATHS_B")
{
nDC = PATHS_B_DC;
nIP = R_PATHS_B_IP;
nFE = R_PATHS_B_FE;
nR1 = PATHS_B_R1;
nR2 = PATHS_B_R2;
nR3 = PATHS_B_R3;
nR4 = PATHS_B_R4;
sSc = PATHS_B_S;
nvalid = 1;
}
if (sBook == "PEERPEN")
{
nDC = PEERPEN_DC;
nIP = R_PEERPEN_IP;
nFE = R_PEERPEN_FE;
nR1 = PEERPEN_R1;
nR2 = PEERPEN_R2;
nR3 = PEERPEN_R3;
nR4 = PEERPEN_R4;
sSc = PEERPEN_S;
nvalid = 1;
}
if (sBook == "PESTIL")
{
nDC = PESTIL_DC;
nIP = R_PESTIL_IP;
nFE = R_PESTIL_FE;
nR1 = PESTIL_R1;
nR2 = PESTIL_R2;
nR3 = PESTIL_R3;
nR4 = PESTIL_R4;
sSc = PESTIL_S;
nvalid = 1;
}
if (sBook == "PIOUS_P")
{
nDC = PIOUS_P_DC;
nIP = R_PIOUS_P_IP;
nFE = R_PIOUS_P_FE;
nR1 = PIOUS_P_R1;
nR2 = PIOUS_P_R2;
nR3 = PIOUS_P_R3;
nR4 = PIOUS_P_R4;
sSc = PIOUS_P_S;
nvalid = 1;
}
if (sBook == "PLANCEL")
{
nDC = PLANCEL_DC;
nIP = R_PLANCEL_IP;
nFE = R_PLANCEL_FE;
nR1 = PLANCEL_R1;
nR2 = PLANCEL_R2;
nR3 = PLANCEL_R3;
nR4 = PLANCEL_R4;
sSc = PLANCEL_S;
nvalid = 1;
}
if (sBook == "PSION_S")
{
nDC = PSION_S_DC;
nIP = R_PSION_S_IP;
nFE = R_PSION_S_FE;
nR1 = PSION_S_R1;
nR2 = PSION_S_R2;
nR3 = PSION_S_R3;
nR4 = PSION_S_R4;
sSc = PSION_S_S;
nvalid = 1;
}
if (sBook == "RAINFIR")
{
nDC = RAINFIR_DC;
nIP = R_RAINFIR_IP;
nFE = R_RAINFIR_FE;
nR1 = RAINFIR_R1;
nR2 = RAINFIR_R2;
nR3 = RAINFIR_R3;
nR4 = RAINFIR_R4;
sSc = RAINFIR_S;
nvalid = 1;
}
if (sBook == "RISEN_R")
{
nDC = RISEN_R_DC;
nIP = R_RISEN_R_IP;
nFE = R_RISEN_R_FE;
nR1 = RISEN_R_R1;
nR2 = RISEN_R_R2;
nR3 = RISEN_R_R3;
nR4 = RISEN_R_R4;
sSc = RISEN_R_S;
nvalid = 1;
}
if (sBook == "RUIN")
{
nDC = RUIN_DC;
nIP = R_RUIN_IP;
nFE = R_RUIN_FE;
nR1 = RUIN_R1;
nR2 = RUIN_R2;
nR3 = RUIN_R3;
nR4 = RUIN_R4;
sSc = RUIN_S;
nvalid = 1;
}
if (sBook == "SINGSUN")
{
nDC = SINGSUN_DC;
nIP = R_SINGSUN_IP;
nFE = R_SINGSUN_FE;
nR1 = SINGSUN_R1;
nR2 = SINGSUN_R2;
nR3 = SINGSUN_R3;
nR4 = SINGSUN_R4;
sSc = SINGSUN_S;
nvalid = 1;
}
if (sBook == "SP_WORM")
{
nDC = SP_WORM_DC;
nIP = R_SP_WORM_IP;
nFE = R_SP_WORM_FE;
nR1 = SP_WORM_R1;
nR2 = SP_WORM_R2;
nR3 = SP_WORM_R3;
nR4 = SP_WORM_R4;
sSc = SP_WORM_S;
nvalid = 1;
}
if (sBook == "STORM_M")
{
nDC = STORM_M_DC;
nIP = R_STORM_M_IP;
nFE = R_STORM_M_FE;
nR1 = STORM_M_R1;
nR2 = STORM_M_R2;
nR3 = STORM_M_R3;
nR4 = STORM_M_R4;
sSc = STORM_M_S;
nvalid = 1;
}
if (sBook == "SUMABER")
{
nDC = SUMABER_DC;
nIP = R_SUMABER_IP;
nFE = R_SUMABER_FE;
nR1 = SUMABER_R1;
nR2 = SUMABER_R2;
nR3 = SUMABER_R3;
nR4 = SUMABER_R4;
sSc = SUMABER_S;
nvalid = 1;
}
if (sBook == "SUP_DIS")
{
nDC = SUP_DIS_DC;
nIP = R_SUP_DIS_IP;
nFE = R_SUP_DIS_FE;
nR1 = SUP_DIS_R1;
nR2 = SUP_DIS_R2;
nR3 = SUP_DIS_R3;
nR4 = SUP_DIS_R4;
sSc = SUP_DIS_S;
nvalid = 1;
}
if (sBook == "SYMRUST")
{
nDC = SYMRUST_DC;
nIP = R_SYMRUST_IP;
nFE = R_SYMRUST_FE;
nR1 = SYMRUST_R1;
nR2 = SYMRUST_R2;
nR3 = SYMRUST_R3;
nR4 = SYMRUST_R4;
sSc = SYMRUST_S;
nvalid = 1;
}
if (sBook == "THEWITH")
{
nDC = THEWITH_DC;
nIP = R_THEWITH_IP;
nFE = R_THEWITH_FE;
nR1 = THEWITH_R1;
nR2 = THEWITH_R2;
nR3 = THEWITH_R3;
nR4 = THEWITH_R4;
sSc = THEWITH_S;
nvalid = 1;
}
if (sBook == "TOLO_KW")
{
nDC = TOLO_KW_DC;
nIP = R_TOLO_KW_IP;
nFE = R_TOLO_KW_FE;
nR1 = TOLO_KW_R1;
nR2 = TOLO_KW_R2;
nR3 = TOLO_KW_R3;
nR4 = TOLO_KW_R4;
sSc = TOLO_KW_S;
nvalid = 1;
}
if (sBook == "TRANVIT")
{
nDC = TRANVIT_DC;
nIP = R_TRANVIT_IP;
nFE = R_TRANVIT_FE;
nR1 = TRANVIT_R1;
nR2 = TRANVIT_R2;
nR3 = TRANVIT_R3;
nR4 = TRANVIT_R4;
sSc = TRANVIT_S;
nvalid = 1;
}
if (sBook == "TWINF")
{
nDC = TWINF_DC;
nIP = R_TWINF_IP;
nFE = R_TWINF_FE;
nR1 = TWINF_R1;
nR2 = TWINF_R2;
nR3 = TWINF_R3;
nR4 = TWINF_R4;
sSc = TWINF_S;
nvalid = 1;
}
if (sBook == "UNHOLYD")
{
nDC = UNHOLYD_DC;
nIP = R_UNHOLYD_IP;
nFE = R_UNHOLYD_FE;
nR1 = UNHOLYD_R1;
nR2 = UNHOLYD_R2;
nR3 = UNHOLYD_R3;
nR4 = UNHOLYD_R4;
sSc = UNHOLYD_S;
nvalid = 1;
}
if (sBook == "UNIMPIN")
{
nDC = UNIMPIN_DC;
nIP = R_UNIMPIN_IP;
nFE = R_UNIMPIN_FE;
nR1 = UNIMPIN_R1;
nR2 = UNIMPIN_R2;
nR3 = UNIMPIN_R3;
nR4 = UNIMPIN_R4;
sSc = UNIMPIN_S;
nvalid = 1;
}
if (sBook == "UNSEENW")
{
nDC = UNSEENW_DC;
nIP = R_UNSEENW_IP;
nFE = R_UNSEENW_FE;
nR1 = UNSEENW_R1;
nR2 = UNSEENW_R2;
nR3 = UNSEENW_R3;
nR4 = UNSEENW_R4;
sSc = UNSEENW_S;
nvalid = 1;
}
if (sBook == "WHIP_SH")
{
nDC = WHIP_SH_DC;
nIP = R_WHIP_SH_IP;
nFE = R_WHIP_SH_FE;
nR1 = WHIP_SH_R1;
nR2 = WHIP_SH_R2;
nR3 = WHIP_SH_R3;
nR4 = WHIP_SH_R4;
sSc = WHIP_SH_S;
nvalid = 1;
}
// Make sure the player is allowed to research from this placeable.
nAllowed = TRUE;
if (nAllowed == TRUE)
{
// Make sure the player doesn't already know this spell.
if (!GetHasFeat(nFE, oPC))
{
if (!nvalid == 1)
{
SendMessageToPC(oPC, "This is not a valid Epic Spellbook");
return;
}
if (GetLocalInt(oPC, "nResearchedEpic") == 1)
{
SendMessageToPC(oPC, "You are mentally exhausted and cannot continue research at this time.");
return;
}
else if (GetLocalInt(oBook, "nResearchDays") == 0)
{
SetLocalInt(oBook, "nResearchDays", 1);
SetLocalInt(oPC, "nResearchedEpic", 1);
SendMessageToPC(oPC, "You research your spell until you cannot focus anymore. You think it will take 6 more days to finish this research");
return;
}
else if (GetLocalInt(oBook, "nResearchDays") == 1)
{
SetLocalInt(oBook, "nResearchDays", 2);
SetLocalInt(oPC, "nResearchedEpic", 1);
SendMessageToPC(oPC, "You research your spell until you cannot focus anymore. You think it will take 5 more days to finish this research");
return;
}
else if (GetLocalInt(oBook, "nResearchDays") == 2)
{
SetLocalInt(oBook, "nResearchDays", 3);
SetLocalInt(oPC, "nResearchedEpic", 1);
SendMessageToPC(oPC, "You research your spell until you cannot focus anymore. You think it will take 4 more days to finish this research");
return;
}
else if (GetLocalInt(oBook, "nResearchDays") == 3)
{
SetLocalInt(oBook, "nResearchDays", 4);
SetLocalInt(oPC, "nResearchedEpic", 1);
SendMessageToPC(oPC, "You research your spell until you cannot focus anymore. You think it will take 3 more days to finish this research");
return;
}
else if (GetLocalInt(oBook, "nResearchDays") == 4)
{
SetLocalInt(oBook, "nResearchDays", 5);
SetLocalInt(oPC, "nResearchedEpic", 1);
SendMessageToPC(oPC, "You research your spell until you cannot focus anymore. You think it will take 2 more days to finish this research");
return;
}
else if (GetLocalInt(oBook, "nResearchDays") == 5)
{
SetLocalInt(oBook, "nResearchDays", 6);
SetLocalInt(oPC, "nResearchedEpic", 1);
SendMessageToPC(oPC, "You research your spell until you cannot focus anymore. You think it will take 1 more days to finish this research");
return;
}
// If applicable, adjust the spell's DC.
if (FOCI_ADJUST_DC == TRUE)
nDC -= GetDCSchoolFocusAdjustment(oPC, sSc);
// Does the player have enough gold?
if (GetHasEnoughGoldToResearch(oPC, nDC))
{
// Does the player have enough extra experience?
if (GetHasEnoughExperienceToResearch(oPC, nDC))
{
// Does the player have all of the other requirements?
if (GetHasRequiredFeatsForResearch(oPC, nR1, nR2, nR3, nR4))
{
DoSpellResearch(oPC, nDC, nIP, sSc, oBook);
}
else
SendMessageToPC(oPC, MES_NOT_HAVE_REQ_FEATS);
}
else
SendMessageToPC(oPC, MES_NOT_ENOUGH_XP);
}
else
SendMessageToPC(oPC, MES_NOT_ENOUGH_GOLD);
}
else
SendMessageToPC(oPC, MES_KNOW_SPELL);
}
else
SendMessageToPC(oPC, MES_CANNOT_RESEARCH_HERE);
}
}

View File

@@ -0,0 +1,998 @@
//:://////////////////////////////////////////////
//:: FileName: "_plc_rsrch_ep_sp"
/* Purpose: This is the OnDisturbed event handler script for a placeable.
When an epic spell's book is placed into the inventory, it will search
and determine validity of the item, and then proceed with the proper
researching functions.
*/
//:://////////////////////////////////////////////
//:: Created By: Boneshank
//:: Last Updated On:
//:://////////////////////////////////////////////
#include "nw_i0_spells"
#include "inc_epicspells"
// This constant sets who may or may not research spells from the placeable
// this script is attached to. For example, if you only want arcane casters
// to be able to research from a lab, and not druids or clerics, you must
// determine the exclusivity for the placebale with this constant.
//
// You should save the script under a different name once constant is set....
//
// Keywords to use for this constant:
// For CLERICS ONLY ---- "CLERIC"
// For DRUIDS ONLY ---- "DRUID"
// For BOTH DRUIDS AND CLERICS ---- "DIVINE"
// For SORCERERS AND WIZARDS ONLY ---- "ARCANE"
// For EVERYONE ---- "ALL"
string WHO_CAN_RESEARCH = "ALL";
void main()
{
if (GetInventoryDisturbType() == INVENTORY_DISTURB_TYPE_ADDED)
{
object oBook = GetInventoryDisturbItem();
object oPC = GetLastDisturbed();
string sBook = GetTag(oBook);
int nDC, nIP, nFE, nR1, nR2, nR3, nR4, nvalid;
int nAllowed;
string sSc;
if (sBook == "A_STONE")
{
nDC = A_STONE_DC;
nIP = R_A_STONE_IP;
nFE = R_A_STONE_FE;
nR1 = A_STONE_R1;
nR2 = A_STONE_R2;
nR3 = A_STONE_R3;
nR4 = A_STONE_R4;
sSc = A_STONE_S;
nvalid = 1;
}
if (sBook == "ACHHEEL")
{
nDC = ACHHEEL_DC;
nIP = R_ACHHEEL_IP;
nFE = R_ACHHEEL_FE;
nR1 = ACHHEEL_R1;
nR2 = ACHHEEL_R2;
nR3 = ACHHEEL_R3;
nR4 = ACHHEEL_R4;
sSc = ACHHEEL_S;
nvalid = 1;
}
if (sBook == "AL_MART")
{
nDC = AL_MART_DC;
nIP = R_AL_MART_IP;
nFE = R_AL_MART_FE;
nR1 = AL_MART_R1;
nR2 = AL_MART_R2;
nR3 = AL_MART_R3;
nR4 = AL_MART_R4;
sSc = AL_MART_S;
nvalid = 1;
}
if (sBook == "ALLHOPE")
{
nDC = ALLHOPE_DC;
nIP = R_ALLHOPE_IP;
nFE = R_ALLHOPE_FE;
nR1 = ALLHOPE_R1;
nR2 = ALLHOPE_R2;
nR3 = ALLHOPE_R3;
nR4 = ALLHOPE_R4;
sSc = ALLHOPE_S;
nvalid = 1;
}
if (sBook == "ANARCHY")
{
nDC = ANARCHY_DC;
nIP = R_ANARCHY_IP;
nFE = R_ANARCHY_FE;
nR1 = ANARCHY_R1;
nR2 = ANARCHY_R2;
nR3 = ANARCHY_R3;
nR4 = ANARCHY_R4;
sSc = ANARCHY_S;
nvalid = 1;
}
if (sBook == "ANBLAST")
{
nDC = ANBLAST_DC;
nIP = R_ANBLAST_IP;
nFE = R_ANBLAST_FE;
nR1 = ANBLAST_R1;
nR2 = ANBLAST_R2;
nR3 = ANBLAST_R3;
nR4 = ANBLAST_R4;
sSc = ANBLAST_S;
nvalid = 1;
}
if (sBook == "ANBLIZZ")
{
nDC = ANBLIZZ_DC;
nIP = R_ANBLIZZ_IP;
nFE = R_ANBLIZZ_FE;
nR1 = ANBLIZZ_R1;
nR2 = ANBLIZZ_R2;
nR3 = ANBLIZZ_R3;
nR4 = ANBLIZZ_R4;
sSc = ANBLIZZ_S;
nvalid = 1;
}
if (sBook == "ARMY_UN")
{
nDC = ARMY_UN_DC;
nIP = R_ARMY_UN_IP;
nFE = R_ARMY_UN_FE;
nR1 = ARMY_UN_R1;
nR2 = ARMY_UN_R2;
nR3 = ARMY_UN_R3;
nR4 = ARMY_UN_R4;
sSc = ARMY_UN_S;
nvalid = 1;
}
if (sBook == "BATTLEB")
{
nDC = BATTLEB_DC;
nIP = R_BATTLEB_IP;
nFE = R_BATTLEB_FE;
nR1 = BATTLEB_R1;
nR2 = BATTLEB_R2;
nR3 = BATTLEB_R3;
nR4 = BATTLEB_R4;
sSc = BATTLEB_S;
nvalid = 1;
}
if (sBook == "CELCOUN")
{
nDC = CELCOUN_DC;
nIP = R_CELCOUN_IP;
nFE = R_CELCOUN_FE;
nR1 = CELCOUN_R1;
nR2 = CELCOUN_R2;
nR3 = CELCOUN_R3;
nR4 = CELCOUN_R4;
sSc = CELCOUN_S;
nvalid = 1;
}
if (sBook == "CHAMP_V")
{
nDC = CHAMP_V_DC;
nIP = R_CHAMP_V_IP;
nFE = R_CHAMP_V_FE;
nR1 = CHAMP_V_R1;
nR2 = CHAMP_V_R2;
nR3 = CHAMP_V_R3;
nR4 = CHAMP_V_R4;
sSc = CHAMP_V_S;
nvalid = 1;
}
if (sBook == "CON_RES")
{
nDC = CON_RES_DC;
nIP = R_CON_RES_IP;
nFE = R_CON_RES_FE;
nR1 = CON_RES_R1;
nR2 = CON_RES_R2;
nR3 = CON_RES_R3;
nR4 = CON_RES_R4;
sSc = CON_RES_S;
nvalid = 1;
}
if (sBook == "CON_REU")
{
nDC = CON_REU_DC;
nIP = R_CON_REU_IP;
nFE = R_CON_REU_FE;
nR1 = CON_REU_R1;
nR2 = CON_REU_R2;
nR3 = CON_REU_R3;
nR4 = CON_REU_R4;
sSc = CON_REU_S;
nvalid = 1;
}
if (sBook == "DEADEYE")
{
nDC = DEADEYE_DC;
nIP = R_DEADEYE_IP;
nFE = R_DEADEYE_FE;
nR1 = DEADEYE_R1;
nR2 = DEADEYE_R2;
nR3 = DEADEYE_R3;
nR4 = DEADEYE_R4;
sSc = DEADEYE_S;
nvalid = 1;
}
if (sBook == "DIREWIN")
{
nDC = DIREWIN_DC;
nIP = R_DIREWIN_IP;
nFE = R_DIREWIN_FE;
nR1 = DIREWIN_R1;
nR2 = DIREWIN_R2;
nR3 = DIREWIN_R3;
nR4 = DIREWIN_R4;
sSc = DIREWIN_S;
nvalid = 1;
}
if (sBook == "DREAMSC")
{
nDC = DREAMSC_DC;
nIP = R_DREAMSC_IP;
nFE = R_DREAMSC_FE;
nR1 = DREAMSC_R1;
nR2 = DREAMSC_R2;
nR3 = DREAMSC_R3;
nR4 = DREAMSC_R4;
sSc = DREAMSC_S;
nvalid = 1;
}
if (sBook == "DRG_KNI")
{
nDC = DRG_KNI_DC;
nIP = R_DRG_KNI_IP;
nFE = R_DRG_KNI_FE;
nR1 = DRG_KNI_R1;
nR2 = DRG_KNI_R2;
nR3 = DRG_KNI_R3;
nR4 = DRG_KNI_R4;
sSc = DRG_KNI_S;
nvalid = 1;
}
if (sBook == "DTHMARK")
{
nDC = DTHMARK_DC;
nIP = R_DTHMARK_IP;
nFE = R_DTHMARK_FE;
nR1 = DTHMARK_R1;
nR2 = DTHMARK_R2;
nR3 = DTHMARK_R3;
nR4 = DTHMARK_R4;
sSc = DTHMARK_S;
nvalid = 1;
}
if (sBook == "DULBLAD")
{
nDC = DULBLAD_DC;
nIP = R_DULBLAD_IP;
nFE = R_DULBLAD_FE;
nR1 = DULBLAD_R1;
nR2 = DULBLAD_R2;
nR3 = DULBLAD_R3;
nR4 = DULBLAD_R4;
sSc = DULBLAD_S;
nvalid = 1;
}
if (sBook == "DWEO_TH")
{
nDC = DWEO_TH_DC;
nIP = R_DWEO_TH_IP;
nFE = R_DWEO_TH_FE;
nR1 = DWEO_TH_R1;
nR2 = DWEO_TH_R2;
nR3 = DWEO_TH_R3;
nR4 = DWEO_TH_R4;
sSc = DWEO_TH_S;
nvalid = 1;
}
if (sBook == "ENSLAVE")
{
nDC = ENSLAVE_DC;
nIP = R_ENSLAVE_IP;
nFE = R_ENSLAVE_FE;
nR1 = ENSLAVE_R1;
nR2 = ENSLAVE_R2;
nR3 = ENSLAVE_R3;
nR4 = ENSLAVE_R4;
sSc = ENSLAVE_S;
nvalid = 1;
}
if (sBook == "EP_M_AR")
{
nDC = EP_M_AR_DC;
nIP = R_EP_M_AR_IP;
nFE = R_EP_M_AR_FE;
nR1 = EP_M_AR_R1;
nR2 = EP_M_AR_R2;
nR3 = EP_M_AR_R3;
nR4 = EP_M_AR_R4;
sSc = EP_M_AR_S;
nvalid = 1;
}
if (sBook == "EP_RPLS")
{
nDC = EP_RPLS_DC;
nIP = R_EP_RPLS_IP;
nFE = R_EP_RPLS_FE;
nR1 = EP_RPLS_R1;
nR2 = EP_RPLS_R2;
nR3 = EP_RPLS_R3;
nR4 = EP_RPLS_R4;
sSc = EP_RPLS_S;
nvalid = 1;
}
if (sBook == "EP_SP_R")
{
nDC = EP_SP_R_DC;
nIP = R_EP_SP_R_IP;
nFE = R_EP_SP_R_FE;
nR1 = EP_SP_R_R1;
nR2 = EP_SP_R_R2;
nR3 = EP_SP_R_R3;
nR4 = EP_SP_R_R4;
sSc = EP_SP_R_S;
nvalid = 1;
}
if (sBook == "EP_WARD")
{
nDC = EP_WARD_DC;
nIP = R_EP_WARD_IP;
nFE = R_EP_WARD_FE;
nR1 = EP_WARD_R1;
nR2 = EP_WARD_R2;
nR3 = EP_WARD_R3;
nR4 = EP_WARD_R4;
sSc = EP_WARD_S;
nvalid = 1;
}
if (sBook == "ET_FREE")
{
nDC = ET_FREE_DC;
nIP = R_ET_FREE_IP;
nFE = R_ET_FREE_FE;
nR1 = ET_FREE_R1;
nR2 = ET_FREE_R2;
nR3 = ET_FREE_R3;
nR4 = ET_FREE_R4;
sSc = ET_FREE_S;
nvalid = 1;
}
if (sBook == "FIEND_W")
{
nDC = FIEND_W_DC;
nIP = R_FIEND_W_IP;
nFE = R_FIEND_W_FE;
nR1 = FIEND_W_R1;
nR2 = FIEND_W_R2;
nR3 = FIEND_W_R3;
nR4 = FIEND_W_R4;
sSc = FIEND_W_S;
nvalid = 1;
}
if (sBook == "FLEETNS")
{
nDC = FLEETNS_DC;
nIP = R_FLEETNS_IP;
nFE = R_FLEETNS_FE;
nR1 = FLEETNS_R1;
nR2 = FLEETNS_R2;
nR3 = FLEETNS_R3;
nR4 = FLEETNS_R4;
sSc = FLEETNS_S;
nvalid = 1;
}
if (sBook == "GEMCAGE")
{
nDC = GEMCAGE_DC;
nIP = R_GEMCAGE_IP;
nFE = R_GEMCAGE_FE;
nR1 = GEMCAGE_R1;
nR2 = GEMCAGE_R2;
nR3 = GEMCAGE_R3;
nR4 = GEMCAGE_R4;
sSc = GEMCAGE_S;
nvalid = 1;
}
if (sBook == "GODSMIT")
{
nDC = GODSMIT_DC;
nIP = R_GODSMIT_IP;
nFE = R_GODSMIT_FE;
nR1 = GODSMIT_R1;
nR2 = GODSMIT_R2;
nR3 = GODSMIT_R3;
nR4 = GODSMIT_R4;
sSc = GODSMIT_S;
nvalid = 1;
}
if (sBook == "GR_RUIN")
{
nDC = GR_RUIN_DC;
nIP = R_GR_RUIN_IP;
nFE = R_GR_RUIN_FE;
nR1 = GR_RUIN_R1;
nR2 = GR_RUIN_R2;
nR3 = GR_RUIN_R3;
nR4 = GR_RUIN_R4;
sSc = GR_RUIN_S;
nvalid = 1;
}
if (sBook == "GR_SP_RE")
{
nDC = GR_SP_RE_DC;
nIP = R_GR_SP_RE_IP;
nFE = R_GR_SP_RE_FE;
nR1 = GR_SP_RE_R1;
nR2 = GR_SP_RE_R2;
nR3 = GR_SP_RE_R3;
nR4 = GR_SP_RE_R4;
sSc = GR_SP_RE_S;
nvalid = 1;
}
if (sBook == "GR_TIME")
{
nDC = GR_TIME_DC;
nIP = R_GR_TIME_IP;
nFE = R_GR_TIME_FE;
nR1 = GR_TIME_R1;
nR2 = GR_TIME_R2;
nR3 = GR_TIME_R3;
nR4 = GR_TIME_R4;
sSc = GR_TIME_S;
nvalid = 1;
}
if (sBook == "HELBALL")
{
nDC = HELBALL_DC;
nIP = R_HELBALL_IP;
nFE = R_HELBALL_FE;
nR1 = HELBALL_R1;
nR2 = HELBALL_R2;
nR3 = HELBALL_R3;
nR4 = HELBALL_R4;
sSc = HELBALL_S;
nvalid = 1;
}
if (sBook == "HELSEND")
{
nDC = HELSEND_DC;
nIP = R_HELSEND_IP;
nFE = R_HELSEND_FE;
nR1 = HELSEND_R1;
nR2 = HELSEND_R2;
nR3 = HELSEND_R3;
nR4 = HELSEND_R4;
sSc = HELSEND_S;
nvalid = 1;
}
if (sBook == "HERCALL")
{
nDC = HERCALL_DC - HERCEMP_DC; // The player only has to pay for upgrade
nIP = R_HERCALL_IP;
nFE = R_HERCALL_FE;
nR1 = HERCALL_R1;
nR2 = HERCALL_R2;
nR3 = HERCALL_R3;
nR4 = HERCALL_R4;
sSc = HERCALL_S;
nvalid = 1;
}
if (sBook == "HERCEMP")
{
nDC = HERCEMP_DC;
nIP = R_HERCEMP_IP;
nFE = R_HERCEMP_FE;
nR1 = HERCEMP_R1;
nR2 = HERCEMP_R2;
nR3 = HERCEMP_R3;
nR4 = HERCEMP_R4;
sSc = HERCEMP_S;
nvalid = 1;
}
if (sBook == "IMPENET")
{
nDC = IMPENET_DC;
nIP = R_IMPENET_IP;
nFE = R_IMPENET_FE;
nR1 = IMPENET_R1;
nR2 = IMPENET_R2;
nR3 = IMPENET_R3;
nR4 = IMPENET_R4;
sSc = IMPENET_S;
nvalid = 1;
}
if (sBook == "LEECH_F")
{
nDC = LEECH_F_DC;
nIP = R_LEECH_F_IP;
nFE = R_LEECH_F_FE;
nR1 = LEECH_F_R1;
nR2 = LEECH_F_R2;
nR3 = LEECH_F_R3;
nR4 = LEECH_F_R4;
sSc = LEECH_F_S;
nvalid = 1;
}
if (sBook == "LEG_ART")
{
nDC = LEG_ART_DC;
nIP = R_LEG_ART_IP;
nFE = R_LEG_ART_FE;
nR1 = LEG_ART_R1;
nR2 = LEG_ART_R2;
nR3 = LEG_ART_R3;
nR4 = LEG_ART_R4;
sSc = LEG_ART_S;
nvalid = 1;
}
if (sBook == "LIFE_FT")
{
nDC = LIFE_FT_DC;
nIP = R_LIFE_FT_IP;
nFE = R_LIFE_FT_FE;
nR1 = LIFE_FT_R1;
nR2 = LIFE_FT_R2;
nR3 = LIFE_FT_R3;
nR4 = LIFE_FT_R4;
sSc = LIFE_FT_S;
nvalid = 1;
}
if (sBook == "MAGMA_B")
{
nDC = MAGMA_B_DC;
nIP = R_MAGMA_B_IP;
nFE = R_MAGMA_B_FE;
nR1 = MAGMA_B_R1;
nR2 = MAGMA_B_R2;
nR3 = MAGMA_B_R3;
nR4 = MAGMA_B_R4;
sSc = MAGMA_B_S;
nvalid = 1;
}
if (sBook == "MASSPEN")
{
nDC = MASSPEN_DC;
nIP = R_MASSPEN_IP;
nFE = R_MASSPEN_FE;
nR1 = MASSPEN_R1;
nR2 = MASSPEN_R2;
nR3 = MASSPEN_R3;
nR4 = MASSPEN_R4;
sSc = MASSPEN_S;
nvalid = 1;
}
if (sBook == "MORI")
{
nDC = MORI_DC;
nIP = R_MORI_IP;
nFE = R_MORI_FE;
nR1 = MORI_R1;
nR2 = MORI_R2;
nR3 = MORI_R3;
nR4 = MORI_R4;
sSc = MORI_S;
nvalid = 1;
}
if (sBook == "MUMDUST")
{
nDC = MUMDUST_DC;
nIP = R_MUMDUST_IP;
nFE = R_MUMDUST_FE;
nR1 = MUMDUST_R1;
nR2 = MUMDUST_R2;
nR3 = MUMDUST_R3;
nR4 = MUMDUST_R4;
sSc = MUMDUST_S;
nvalid = 1;
}
if (sBook == "NAILSKY")
{
nDC = NAILSKY_DC;
nIP = R_NAILSKY_IP;
nFE = R_NAILSKY_FE;
nR1 = NAILSKY_R1;
nR2 = NAILSKY_R2;
nR3 = NAILSKY_R3;
nR4 = NAILSKY_R4;
sSc = NAILSKY_S;
nvalid = 1;
}
if (sBook == "NIGHTSU")
{
nDC = NIGHTSU_DC;
nIP = R_NIGHTSU_IP;
nFE = R_NIGHTSU_FE;
nR1 = NIGHTSU_R1;
nR2 = NIGHTSU_R2;
nR3 = NIGHTSU_R3;
nR4 = NIGHTSU_R4;
sSc = NIGHTSU_S;
nvalid = 1;
}
if (sBook == "ORDER_R")
{
nDC = ORDER_R_DC;
nIP = R_ORDER_R_IP;
nFE = R_ORDER_R_FE;
nR1 = ORDER_R_R1;
nR2 = ORDER_R_R2;
nR3 = ORDER_R_R3;
nR4 = ORDER_R_R4;
sSc = ORDER_R_S;
nvalid = 1;
}
if (sBook == "PATHS_B")
{
nDC = PATHS_B_DC;
nIP = R_PATHS_B_IP;
nFE = R_PATHS_B_FE;
nR1 = PATHS_B_R1;
nR2 = PATHS_B_R2;
nR3 = PATHS_B_R3;
nR4 = PATHS_B_R4;
sSc = PATHS_B_S;
nvalid = 1;
}
if (sBook == "PEERPEN")
{
nDC = PEERPEN_DC;
nIP = R_PEERPEN_IP;
nFE = R_PEERPEN_FE;
nR1 = PEERPEN_R1;
nR2 = PEERPEN_R2;
nR3 = PEERPEN_R3;
nR4 = PEERPEN_R4;
sSc = PEERPEN_S;
nvalid = 1;
}
if (sBook == "PESTIL")
{
nDC = PESTIL_DC;
nIP = R_PESTIL_IP;
nFE = R_PESTIL_FE;
nR1 = PESTIL_R1;
nR2 = PESTIL_R2;
nR3 = PESTIL_R3;
nR4 = PESTIL_R4;
sSc = PESTIL_S;
nvalid = 1;
}
if (sBook == "PIOUS_P")
{
nDC = PIOUS_P_DC;
nIP = R_PIOUS_P_IP;
nFE = R_PIOUS_P_FE;
nR1 = PIOUS_P_R1;
nR2 = PIOUS_P_R2;
nR3 = PIOUS_P_R3;
nR4 = PIOUS_P_R4;
sSc = PIOUS_P_S;
nvalid = 1;
}
if (sBook == "PLANCEL")
{
nDC = PLANCEL_DC;
nIP = R_PLANCEL_IP;
nFE = R_PLANCEL_FE;
nR1 = PLANCEL_R1;
nR2 = PLANCEL_R2;
nR3 = PLANCEL_R3;
nR4 = PLANCEL_R4;
sSc = PLANCEL_S;
nvalid = 1;
}
if (sBook == "PSION_S")
{
nDC = PSION_S_DC;
nIP = R_PSION_S_IP;
nFE = R_PSION_S_FE;
nR1 = PSION_S_R1;
nR2 = PSION_S_R2;
nR3 = PSION_S_R3;
nR4 = PSION_S_R4;
sSc = PSION_S_S;
nvalid = 1;
}
if (sBook == "RAINFIR")
{
nDC = RAINFIR_DC;
nIP = R_RAINFIR_IP;
nFE = R_RAINFIR_FE;
nR1 = RAINFIR_R1;
nR2 = RAINFIR_R2;
nR3 = RAINFIR_R3;
nR4 = RAINFIR_R4;
sSc = RAINFIR_S;
nvalid = 1;
}
if (sBook == "RISEN_R")
{
nDC = RISEN_R_DC;
nIP = R_RISEN_R_IP;
nFE = R_RISEN_R_FE;
nR1 = RISEN_R_R1;
nR2 = RISEN_R_R2;
nR3 = RISEN_R_R3;
nR4 = RISEN_R_R4;
sSc = RISEN_R_S;
nvalid = 1;
}
if (sBook == "RUIN")
{
nDC = RUIN_DC;
nIP = R_RUIN_IP;
nFE = R_RUIN_FE;
nR1 = RUIN_R1;
nR2 = RUIN_R2;
nR3 = RUIN_R3;
nR4 = RUIN_R4;
sSc = RUIN_S;
nvalid = 1;
}
if (sBook == "SINGSUN")
{
nDC = SINGSUN_DC;
nIP = R_SINGSUN_IP;
nFE = R_SINGSUN_FE;
nR1 = SINGSUN_R1;
nR2 = SINGSUN_R2;
nR3 = SINGSUN_R3;
nR4 = SINGSUN_R4;
sSc = SINGSUN_S;
nvalid = 1;
}
if (sBook == "SP_WORM")
{
nDC = SP_WORM_DC;
nIP = R_SP_WORM_IP;
nFE = R_SP_WORM_FE;
nR1 = SP_WORM_R1;
nR2 = SP_WORM_R2;
nR3 = SP_WORM_R3;
nR4 = SP_WORM_R4;
sSc = SP_WORM_S;
nvalid = 1;
}
if (sBook == "STORM_M")
{
nDC = STORM_M_DC;
nIP = R_STORM_M_IP;
nFE = R_STORM_M_FE;
nR1 = STORM_M_R1;
nR2 = STORM_M_R2;
nR3 = STORM_M_R3;
nR4 = STORM_M_R4;
sSc = STORM_M_S;
nvalid = 1;
}
if (sBook == "SUMABER")
{
nDC = SUMABER_DC;
nIP = R_SUMABER_IP;
nFE = R_SUMABER_FE;
nR1 = SUMABER_R1;
nR2 = SUMABER_R2;
nR3 = SUMABER_R3;
nR4 = SUMABER_R4;
sSc = SUMABER_S;
nvalid = 1;
}
if (sBook == "SUP_DIS")
{
nDC = SUP_DIS_DC;
nIP = R_SUP_DIS_IP;
nFE = R_SUP_DIS_FE;
nR1 = SUP_DIS_R1;
nR2 = SUP_DIS_R2;
nR3 = SUP_DIS_R3;
nR4 = SUP_DIS_R4;
sSc = SUP_DIS_S;
nvalid = 1;
}
if (sBook == "SYMRUST")
{
nDC = SYMRUST_DC;
nIP = R_SYMRUST_IP;
nFE = R_SYMRUST_FE;
nR1 = SYMRUST_R1;
nR2 = SYMRUST_R2;
nR3 = SYMRUST_R3;
nR4 = SYMRUST_R4;
sSc = SYMRUST_S;
nvalid = 1;
}
if (sBook == "THEWITH")
{
nDC = THEWITH_DC;
nIP = R_THEWITH_IP;
nFE = R_THEWITH_FE;
nR1 = THEWITH_R1;
nR2 = THEWITH_R2;
nR3 = THEWITH_R3;
nR4 = THEWITH_R4;
sSc = THEWITH_S;
nvalid = 1;
}
if (sBook == "TOLO_KW")
{
nDC = TOLO_KW_DC;
nIP = R_TOLO_KW_IP;
nFE = R_TOLO_KW_FE;
nR1 = TOLO_KW_R1;
nR2 = TOLO_KW_R2;
nR3 = TOLO_KW_R3;
nR4 = TOLO_KW_R4;
sSc = TOLO_KW_S;
nvalid = 1;
}
if (sBook == "TRANVIT")
{
nDC = TRANVIT_DC;
nIP = R_TRANVIT_IP;
nFE = R_TRANVIT_FE;
nR1 = TRANVIT_R1;
nR2 = TRANVIT_R2;
nR3 = TRANVIT_R3;
nR4 = TRANVIT_R4;
sSc = TRANVIT_S;
nvalid = 1;
}
if (sBook == "TWINF")
{
nDC = TWINF_DC;
nIP = R_TWINF_IP;
nFE = R_TWINF_FE;
nR1 = TWINF_R1;
nR2 = TWINF_R2;
nR3 = TWINF_R3;
nR4 = TWINF_R4;
sSc = TWINF_S;
nvalid = 1;
}
if (sBook == "UNHOLYD")
{
nDC = UNHOLYD_DC;
nIP = R_UNHOLYD_IP;
nFE = R_UNHOLYD_FE;
nR1 = UNHOLYD_R1;
nR2 = UNHOLYD_R2;
nR3 = UNHOLYD_R3;
nR4 = UNHOLYD_R4;
sSc = UNHOLYD_S;
nvalid = 1;
}
if (sBook == "UNIMPIN")
{
nDC = UNIMPIN_DC;
nIP = R_UNIMPIN_IP;
nFE = R_UNIMPIN_FE;
nR1 = UNIMPIN_R1;
nR2 = UNIMPIN_R2;
nR3 = UNIMPIN_R3;
nR4 = UNIMPIN_R4;
sSc = UNIMPIN_S;
nvalid = 1;
}
if (sBook == "UNSEENW")
{
nDC = UNSEENW_DC;
nIP = R_UNSEENW_IP;
nFE = R_UNSEENW_FE;
nR1 = UNSEENW_R1;
nR2 = UNSEENW_R2;
nR3 = UNSEENW_R3;
nR4 = UNSEENW_R4;
sSc = UNSEENW_S;
nvalid = 1;
}
if (sBook == "WHIP_SH")
{
nDC = WHIP_SH_DC;
nIP = R_WHIP_SH_IP;
nFE = R_WHIP_SH_FE;
nR1 = WHIP_SH_R1;
nR2 = WHIP_SH_R2;
nR3 = WHIP_SH_R3;
nR4 = WHIP_SH_R4;
sSc = WHIP_SH_S;
nvalid = 1;
}
// Make sure the player is allowed to research from this placeable.
nAllowed = FALSE;
if (WHO_CAN_RESEARCH == "CLERIC" && GetIsEpicCleric(oPC)) nAllowed = TRUE;
if (WHO_CAN_RESEARCH == "DRUID" && GetIsEpicDruid(oPC)) nAllowed = TRUE;
if (WHO_CAN_RESEARCH == "DIVINE" &&
(GetIsEpicCleric(oPC) || GetIsEpicDruid(oPC))) nAllowed = TRUE;
if (WHO_CAN_RESEARCH == "ARCANE" && GetIsEpicSorcerer(oPC)) nAllowed = TRUE;
if (WHO_CAN_RESEARCH == "ARCANE" && GetIsEpicWizard(oPC)) nAllowed = TRUE;
if (WHO_CAN_RESEARCH == "ALL" &&
(GetIsEpicCleric(oPC) || GetIsEpicDruid(oPC) ||
GetIsEpicSorcerer(oPC) || GetIsEpicWizard(oPC))) nAllowed = TRUE;
if (nAllowed == TRUE)
{
// Make sure the player doesn't already know this spell.
if (!GetHasFeat(nFE, oPC))
{
if (!nvalid == 1)
{
SendMessageToPC(oPC, "This is not a valid Epic Spellbook");
return;
}
else
{
if (GetLocalInt(oPC, "nResearchedEpic") == 1)
{
SendMessageToPC(oPC, "You are mentally exhausted and cannot continue research at this time.");
return;
}
else if (GetLocalInt(oBook, "nResearchDays") == 0)
{
SetLocalInt(oBook, "nResearchDays", 1);
SetLocalInt(oPC, "nResearchedEpic", 1);
SendMessageToPC(oPC, "You research your spell until you cannot focus anymore. You think it will take 6 more days to finish this research");
return;
}
else if (GetLocalInt(oBook, "nResearchDays") == 1)
{
SetLocalInt(oBook, "nResearchDays", 2);
SetLocalInt(oPC, "nResearchedEpic", 1);
SendMessageToPC(oPC, "You research your spell until you cannot focus anymore. You think it will take 5 more days to finish this research");
return;
}
else if (GetLocalInt(oBook, "nResearchDays") == 2)
{
SetLocalInt(oBook, "nResearchDays", 3);
SetLocalInt(oPC, "nResearchedEpic", 1);
SendMessageToPC(oPC, "You research your spell until you cannot focus anymore. You think it will take 4 more days to finish this research");
return;
}
else if (GetLocalInt(oBook, "nResearchDays") == 3)
{
SetLocalInt(oBook, "nResearchDays", 4);
SetLocalInt(oPC, "nResearchedEpic", 1);
SendMessageToPC(oPC, "You research your spell until you cannot focus anymore. You think it will take 3 more days to finish this research");
return;
}
else if (GetLocalInt(oBook, "nResearchDays") == 4)
{
SetLocalInt(oBook, "nResearchDays", 5);
SetLocalInt(oPC, "nResearchedEpic", 1);
SendMessageToPC(oPC, "You research your spell until you cannot focus anymore. You think it will take 2 more days to finish this research");
return;
}
else if (GetLocalInt(oBook, "nResearchDays") == 5)
{
SetLocalInt(oBook, "nResearchDays", 6);
SetLocalInt(oPC, "nResearchedEpic", 1);
SendMessageToPC(oPC, "You research your spell until you cannot focus anymore. You think it will take 1 more days to finish this research");
return;
}
// If applicable, adjust the spell's DC.
if (FOCI_ADJUST_DC == TRUE)
nDC -= GetDCSchoolFocusAdjustment(oPC, sSc);
// Does the player have enough gold?
if (GetHasEnoughGoldToResearch(oPC, nDC))
{
// Does the player have enough extra experience?
if (GetHasEnoughExperienceToResearch(oPC, nDC))
{
// Does the player have all of the other requirements?
if (GetHasRequiredFeatsForResearch(oPC, nR1, nR2, nR3, nR4))
{
DoSpellResearch(oPC, nDC, nIP, sSc, oBook);
}
else
SendMessageToPC(oPC, MES_NOT_HAVE_REQ_FEATS);
}
else
SendMessageToPC(oPC, MES_NOT_ENOUGH_XP);
}
else
SendMessageToPC(oPC, MES_NOT_ENOUGH_GOLD);
}
else
SendMessageToPC(oPC, MES_KNOW_SPELL);
}
else
SendMessageToPC(oPC, MES_CANNOT_RESEARCH_HERE);
}
}

View File

@@ -0,0 +1,24 @@
// x2_mod_def_aqu,prc_onaquire
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onacquireitem event.
//
/////////////////////////////////////////////////////////////////////
#include "f_vampire_aquire"
void main()
{
VampireAcquireItem();
{
ExecuteScript("x2_mod_def_aqu", OBJECT_SELF);
ExecuteScript("prc_onaquire", OBJECT_SELF);
ExecuteScript("wrap_mod_onaqu", OBJECT_SELF);
}
}

View File

@@ -0,0 +1,19 @@
// dmfi_activate,prc_onactivate
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onactivateitem event.
//
/////////////////////////////////////////////////////////////////////
#include "f_vampire_activa"
void main()
{
VampireItemCheck();
{
// ExecuteScript("nw_s3_actitem01", OBJECT_SELF);
ExecuteScript("prc_onactivate", OBJECT_SELF);
ExecuteScript("x2_mod_def_act", OBJECT_SELF);
}
}

View File

@@ -0,0 +1,22 @@
// pwdb_mod_onclex,prc_onenter
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the oncliententer event.
//
/////////////////////////////////////////////////////////////////////
#include "f_vampire_clentr"
void main()
{
Vampire_Client_Enter(GetEnteringObject());
ExecuteScript("pwdb_mod_onclex", OBJECT_SELF);
ExecuteScript("prc_onenter", OBJECT_SELF);
ExecuteScript("alt_givewidget", OBJECT_SELF);
}

View File

@@ -0,0 +1,41 @@
#include "f_vampire_defs"
#include "f_vampire_spls_h"
#include "f_vampire_persis"
void Vampire_Client_Exit(object oPC)
{
object oCoffin = GetLocalObject(oPC, "FALLEN_VAMPIRE_COFFIN");
location lL;
if(GetIsVampire(oPC) && GetLocalInt(oPC, "FALLEN_VAMPIRE_COFFIN_VALID") && GetIsObjectValid(oCoffin))
{
Vampire_Set_Int(oPC, "FALLEN_VAMPIRE_COFFIN_GARLIC", GetLocalInt(oCoffin, "FALLEN_VAMPIRE_GARLIC"));
Vampire_Set_Int(oPC, "FALLEN_VAMPIRE_COFFIN_HWATER", GetLocalInt(oCoffin, "FALLEN_VAMPIRE_HOLYWATER"));
Vampire_Set_Int(oPC, "FALLEN_VAMPIRE_COFFIN_ROSE", GetLocalInt(oCoffin, "FALLEN_VAMPIRE_ROSEWARD"));
if(WhatToDoWithTheCoffin < 4 || WhatToDoWithTheCoffin > 5) DestroyObject(oCoffin);
else
{
DeleteLocalObject(oPC, "FALLEN_VAMPIRE_COFFIN");
DeleteLocalObject(oCoffin, "FALLEN_VAMPIRE_COFFIN");
}
}
}
// Check to see if player is dead and trying to avoid death penalties
// if (GetCurrentHitPoints(oPlayer) <= 0)
// SetLocalInt (GetModule(), "death"+GetName(oPlayer), 1);
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onclientleave event.
//
/////////////////////////////////////////////////////////////////////
#include "nw_o0_itemmaker"
void main()
{
ExecuteScript("pwdb_clientleave", OBJECT_SELF);
ExecuteScript("prc_onleave", OBJECT_SELF);
}

View File

@@ -0,0 +1,13 @@
// pwdb_mod_onhb,prc_onheartbeat
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onheartbeat event.
//
/////////////////////////////////////////////////////////////////////
void main()
{
ExecuteScript("pwdb_mod_onhb", OBJECT_SELF);
ExecuteScript("prc_onheartbeat", OBJECT_SELF);
}

View File

@@ -0,0 +1,68 @@
// savechars,prc_onmodload
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onmoduleload event.
//
/////////////////////////////////////////////////////////////////////
#include "x2_inc_switches"
float fMsgTimer = 45.0;
//Restart Module Msg
void DoModuleMsg();
// Restart Module
void RestartModule();
void main()
{
//if you are using another spellscript override you will need to execute the
//"f_vampirespells" script right before returning to the spell. If an altered
//spell is ran by f_vampirespells SetModuleOverrideSpellScriptFinished will be
//set (see x2_inc_switches and x2_inc_spellhook for more info).
SetModuleOverrideSpellscript("f_vampirespells");
{
ExecuteScript("savechars", OBJECT_SELF);
ExecuteScript("prc_onmodload", OBJECT_SELF);
DelayCommand(28800.0, RestartModule());// 4 hrs
}
}
void DoModuleMsg()
{
//Count down msg timer...
fMsgTimer -= 1.0f;
object oPC = GetFirstPC();
while (GetIsObjectValid(oPC))
{
SendMessageToPC(oPC, "Reset in "+FloatToString(fMsgTimer, 0, 0)+" secs.");
oPC = GetNextPC();
}
if(fMsgTimer != 0.0)
{
DelayCommand(1.0, DoModuleMsg());
}
else
{
ExportAllCharacters();
oPC = GetFirstPC();
while (GetIsObjectValid(oPC))
{
BootPC(oPC);
oPC = GetNextPC();
}
}
}
void RestartModule()
{
DoModuleMsg();
DelayCommand(fMsgTimer + 4.0, SetLocalString(GetModule(),"NWNX!RESETPLUGIN!SHUTDOWN","1"));
}

View File

@@ -0,0 +1,21 @@
// nw_o0_death,prc_ondeath
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onplayerdeath event.
//
/////////////////////////////////////////////////////////////////////
#include "f_vampire_spls_h"
void main()
{
object oPC = GetLastPlayerDied();
if(GetIsVampire(oPC)) ExecuteScript("f_vampiredied", oPC);
else ExecuteScript("nw_o0_death", oPC);
{
ExecuteScript("nw_o0_death", OBJECT_SELF);
ExecuteScript("prc_ondeath", OBJECT_SELF);
}
}

View File

@@ -0,0 +1,13 @@
// playerdying,prc_ondying
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onplayerdying event.
//
/////////////////////////////////////////////////////////////////////
void main()
{
ExecuteScript("playerdying", OBJECT_SELF);
ExecuteScript("prc_ondying", OBJECT_SELF);
}

View File

@@ -0,0 +1,13 @@
// curseitemequipe,prc_equip
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onplayerequipitem event.
//
/////////////////////////////////////////////////////////////////////
void main()
{
ExecuteScript("curseitemequipe", OBJECT_SELF);
ExecuteScript("prc_equip", OBJECT_SELF);
}

View File

@@ -0,0 +1,13 @@
// res_onrespawn,prc_onrespawn
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onplayerrespawn event.
//
/////////////////////////////////////////////////////////////////////
void main()
{
ExecuteScript("res_onrespawn", OBJECT_SELF);
ExecuteScript("prc_onrespawn", OBJECT_SELF);
}

View File

@@ -0,0 +1,22 @@
#include "f_vampire_onrest"
void main()
{
if(Vampire_On_Rest()) return; //if this returns true then the resting pc was a
//vampire and this function has handled them so
//return to exit the script.
//Your onrest script here!
// x2_mod_def_rest,prc_rest
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onplayerrest event.
//
/////////////////////////////////////////////////////////////////////
{
ExecuteScript("runeresting", OBJECT_SELF);
ExecuteScript("prc_rest", OBJECT_SELF);
}
}

View File

@@ -0,0 +1,13 @@
// curseitemunequip,prc_unequip
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onplayerunequipitem event.
//
/////////////////////////////////////////////////////////////////////
void main()
{
ExecuteScript("curseitemunequip", OBJECT_SELF);
ExecuteScript("prc_unequip", OBJECT_SELF);
}

View File

@@ -0,0 +1,25 @@
// x2_mod_def_unaqu,prc_onunaquire
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onunaquireitem event.
//
/////////////////////////////////////////////////////////////////////
#include "f_vampire_idrop"
void main()
{
VampireItemDrop();
{
ExecuteScript("x2_mod_def_unaqu", OBJECT_SELF);
ExecuteScript("prc_onunaquire", OBJECT_SELF);
object oItem = GetModuleItemLost();
object oPC = GetModuleItemLostBy();
SetLocalObject(oItem, "LastOwner", oPC);
SetLocalString(oItem, "LastOwnerName", GetName(oPC));
SetLocalString(oItem, "LastOwnerPlayerName", GetPCPlayerName(oPC));
}
}

425
_removed/nw_c2_custom9.nss Normal file
View File

@@ -0,0 +1,425 @@
////////////////////////////////////////////////////////////////////////////////
//
// Olander's AI
// nw_c2_default9
// by Don Anderson
// dandersonru@msn.com
//
// OnSpawn
//
////////////////////////////////////////////////////////////////////////////////
//NWN Bases
#include "x0_i0_anims"
#include "x0_i0_treasure"
#include "x2_inc_switches"
#include "oai_inc_ai"
#include "oai_inc_spawn"
void main()
{
object oNPC = OBJECT_SELF;
/******************************************************************************/
//: PRE SPAWN ADDITONS BELOW HERE
//Custom Scripts you Need to Execute
ExecuteScript("oai_cust_spawn", OBJECT_SELF);
//Randomize Abilities
SetRandomAbilitiesOnCreatureSpawn();
if ((GetLocalInt(GetModule(), "X2_L_NOTREASURE") == FALSE) &&
(GetLocalInt(OBJECT_SELF, "X2_L_NOTREASURE") == FALSE) )
{
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF);
}
//GenerateNPCTreasure(); //nwn treasure script call
//: PRE SPAWN ADDITONS ABOVE HERE
/******************************************************************************/
/******************************************************************************/
// :: COMMON AI SWITCHES
// * Fast Buff Switches:
if (GetLocalInt(OBJECT_SELF, "OAI_FAST_BUFF_COMPLETE") == 1)
SetBattleCondition(OAI_FAST_BUFF_COMPLETE);//Everything.....Right Now
if (GetLocalInt(OBJECT_SELF, "OAI_FAST_BUFF_ADVANCED") == 1)
SetBattleCondition(OAI_FAST_BUFF_ADVANCED);//Lots of the Best Buffs and Enemies within 30 Meters
if (GetLocalInt(OBJECT_SELF, "OAI_FAST_BUFF_RANDOM") == 1)
SetBattleCondition(OAI_FAST_BUFF_RANDOM);//Random Buff
if (GetLocalInt(OBJECT_SELF, "OAI_FAST_BUFF_SUMMON") == 1)
SetBattleCondition(OAI_FAST_BUFF_SUMMON);//Instant call Summon Creature
// * Return to Spawned Location
if (GetLocalInt(OBJECT_SELF, "OAI_RETURN_TO_SPAWNPOINT") == 1)
SetBattleCondition(OAI_RETURN_TO_SPAWNPOINT);
// * Aura switch:
if (GetLocalInt(OBJECT_SELF, "OAI_CAST_AURAS_NOW") == 1)
SetBattleCondition(OAI_CAST_AURAS_NOW);
// * Morale Switches (Originally By Jeff Petersen)
/*
FIGHT_OR_FLIGHT: Added a comment-out feature to set a local
int on creatures to signal FIGHT_OR_FLIGHT. Disable this
function by commenting it out. Only affects non-undead,
non-dominated creatures with int > 5, CR or HD < 5, and
no fear-specific feats.
*/
//FOF_Set();
/*
FIGHT_OR_FLIGHT:: A comment-in feature for leaders, works with
the morale system. Creatures fleeing will look for a leader in
range, then rally to him. If no leader and no other rallying
point, they will run away rather willy-nilly.
*/
//SetBattleCondition(OAI_ROLE_GROUP_LEADER);
// :: COMMON AI SWITCHES
/******************************************************************************/
/******************************************************************************/
// :: SPECIAL ABILITIES
// * Blinking
/*
Blinking is just a short range teleport used in battle to confuse the
enemy and give casters a extra couple of seconds to cast a spell. There
are 2 types of blink that you can use, the first is OAI_BLINK_SELF which
will cause this NPC to teleport to different places around the battle.
The other type (which can be enabled at the same time) is OAI_BLINK_OTHER
which will teleport anyone who hits the caster physically. Both blink
types can have a failure rate set in OAI_BLINK_FAILURE where a 0 means
they blink every round and a 100 means they never blink.
*/
if (GetLocalInt(OBJECT_SELF, "OAI_BLINK_SELF") == 1)
SetBattleCondition(OAI_BLINK_SELF);
if (GetLocalInt(OBJECT_SELF, "OAI_BLINK_OTHERS") == 1)
SetBattleCondition(OAI_BLINK_OTHERS);
//SetLocalInt(OBJECT_SELF, "OAI_BLINK_FAILURE", 10); //failure rate of 10%
// * Illusionary Creature
/*
An illusionary creature looks like something it is not. There is an
Illusion Break DC that must be overcome vs. Will Save.
So make your True Spawn and then Change the Appearance Type Below to
what the creature should Appear As.
*/
//SetLocalInt(OBJECT_SELF, "OAI_ILLUSION_DC", 25); //DC of 25
//SetLocalInt(OBJECT_SELF, "OAI_REAL_SELF", APPEARANCE_TYPE_*);
// * Shapechanger (Not for Shifters!!)
/*
A shapechanger just uses a permanent type of polymorph spell and has
a chance of going off each round depending upon the health of
the NPC. Just uncomment and supply the value you want and your done.
*/
//SetLocalInt(OBJECT_SELF, "OAI_SHAPECHANGE", POLYMORPH_TYPE_PIXIE);
// * Summon Hordes (Not Needed with NESS)
/*
Every round the creature has a chance of summoning another OAI_SUMMON.
For example, if you have the pixie king with OAI_SUMMON set to "pixie"
and OAI_SUMMON_FAILURE set to 0, every round another pixie will join the
battle using OAI_SUMMON_FX to appear. If the summon fx is 0 or not defined
it will use no summoning effect.
*/
//SetLocalString(OBJECT_SELF, "OAI_SUMMON", "pixie"); //replace pixie with the resref of the creature it really is, if needed.
//SetLocalInt(OBJECT_SELF, "OAI_SUMMON_FAILURE", 25); //25% chance of failure per round
//SetLocalInt(OBJECT_SELF, "OAI_SUMMON_FX", VFX_FNF_SUMMON_MONSTER_1);
// * Special Conversations
/*
Use the file "nw_d2_gen_check" in a converation (first string) and they
will say it when they see an enemy.
*/
if (GetLocalInt(OBJECT_SELF, "NW_FLAG_SPECIAL_CONVERSATION") == 1)
SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
/*
Similar to above BUT use "nw_d2_gen_combat" in the tree though.
This causes the creature to say a special greeting in their conversation file
upon Perceiving the player. Attach the [nw_d2_gen_check.nss] script to the desired
greeting in order to designate it. As the creature is actually saying this to
himself, don't attach any player responses to the greeting.
*/
if (GetLocalInt(OBJECT_SELF, "NW_FLAG_SPECIAL_COMBAT_CONVERSATION") == 1)
SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// * Auto-stealth
/*
The NPC will go into stealth mode when not in combat.
*/
if (GetLocalInt(OBJECT_SELF, "NW_FLAG_STEALTH") == 1)
SetSpawnInCondition(NW_FLAG_STEALTH);
// * Auto-search
/*
The NPC will go into search mode when not in combat
*/
if (GetLocalInt(OBJECT_SELF, "NW_FLAG_SEARCH") == 1)
SetSpawnInCondition(NW_FLAG_SEARCH);
// * Herbavores and Omnivores
/*
This is great for making Animals Behave like natural animals should. Most of the
standard palette Animals are automatically set for this.
NOTE: Uncomment ONLY 1 Below. This also DOES NOT work with the Special
Combat Abilities below.
*/
if (GetLocalInt(OBJECT_SELF, "NW_FLAG_BEHAVIOR_HERBIVORE") == 1)
SetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE);
if (GetLocalInt(OBJECT_SELF, "NW_FLAG_BEHAVIOR_OMNIVORE") == 1)
SetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE);
// :: SPECIAL ABILITIES
/******************************************************************************/
/******************************************************************************/
// :: SPECIAL COMBAT ABILITIES
// * These are special flags that can be set on creatures to
// * make them follow certain specialized combat tactics.
// * NOTE: ONLY ONE OF THESE CAN BE SET ON A SINGLE CREATURE.
// * EXCEPT DENOTED BY (*) WHICH CAN BE USED IN ANY
// * COMBINATION
// * Ranged attacker
// * Will attempt to stay at ranged distance from their
// * target. This WILL use the Arcane Archer Feats/Skills
if (GetLocalInt(OBJECT_SELF, "OAI_COMBAT_FLAG_RANGED") == 1)
SetBattleCondition(OAI_COMBAT_FLAG_RANGED);
// * Defensive attacker
// * Will use defensive combat feats and parry
// * Monks will use this Automatically
if (GetLocalInt(OBJECT_SELF, "OAI_COMBAT_FLAG_DEFENSIVE") == 1)
SetBattleCondition(OAI_COMBAT_FLAG_DEFENSIVE);
// * Ambusher
// * Will go stealthy/invisible and attack, then
// * run away and try to go stealthy again before
// * attacking anew. Any Sneaks? They will use this
// * automatically.
if (GetLocalInt(OBJECT_SELF, "OAI_COMBAT_FLAG_AMBUSHER") == 1)
SetBattleCondition(OAI_COMBAT_FLAG_AMBUSHER);
// * Cowardly
// * Cowardly creatures will attempt to flee attackers.
// * Optional: You can place ANY # of Objects with the Tag OAI_SAFE
// * and they will attempt to run to that object.
if (GetLocalInt(OBJECT_SELF, "OAI_COMBAT_FLAG_COWARDLY") == 1)
SetBattleCondition(OAI_COMBAT_FLAG_COWARDLY);
// * Beholder
// * They will use their Eyeball Rays and Special Abilities
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_BEHOLDER") == 1)
SetBattleCondition(OAI_ROLE_BEHOLDER);
// * Gelatinous Cubes
// * They will try to get close and Engulf their Victims
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_GELATINOUSCUBE") == 1)
SetBattleCondition(OAI_ROLE_GELATINOUSCUBE);
// * Trolls
// * Tough to bring these down...need Fire or Acid to Destroy them
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_TROLL") == 1)
SetBattleCondition(OAI_ROLE_TROLL);
// * Spiders
// * Spiders Use Their Web Abilities To Swing Around In Battle. They Also
// * Tend go for the Weakest Creature.
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_SPIDER") == 1)
SetBattleCondition(OAI_ROLE_SPIDER);
// * Mindflayers
// * They will use their Special Brain Suck and Mind Blasts as their
// * Primary Choices. They will resort to Psionics/Spells or Melee if
// * Conditions are not right for their Special Abilities
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_MINDFLAYER") == 1)
SetBattleCondition(OAI_ROLE_MINDFLAYER);
// * Ghosts (*)
// * Apply Ghosting Effects to a Creature
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_GHOST") == 1)
SetBattleCondition(OAI_ROLE_GHOST);
// * Quicklings/Speedy Folk (*)
// * Pretty Simple Really....Applies a Permanent Haste Effect on Creature
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_SPEEDY") == 1)
SetBattleCondition(OAI_ROLE_SPEEDY);
// * Number of Attacks (*)
// * Have Creatures with Multiple Arms or Heads or Maybe just want them to be
// * a Naturally Better with Attacks? Well....do that here.
// * Uncomment Below and set the Number of Attacks to what you need (Range 1 to 5)
// * Note: If you leave the Number of Attacks Commented (Green) then 5 is used
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_NUMBEROFATTACKS") == 1)
SetBattleCondition(OAI_ROLE_NUMBEROFATTACKS);
// SetLocalInt(OBJECT_SELF,"OAI_ROLE_NUMBEROFATTACKS",5); /* <= CHANGE THAT 5 */
//: SPECIAL ABILITES
/******************************************************************************/
/******************************************************************************/
//: ANIMATIONS
// * Separate the NPC's waypoints into day & night.
// * See comment on WalkWayPoints() for use.
// *
SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
// * If this is set, the NPC will appear using the "EffectAppear"
// * animation instead of fading in...Ie....Drop-In Animation
// *
if (GetLocalInt(OBJECT_SELF, "NW_FLAG_APPEAR_SPAWN_IN_ANIMATION") == 1)
SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
// * This will cause an NPC to use common animations it possesses,
// * and use social ones to any other nearby friendly NPCs.
// *
if (GetLocalInt(OBJECT_SELF, "NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS") == 1)
SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
// * This will cause an NPC to wander randomly around the area.
// * and use social ones to any other nearby friendly NPCs.
// *
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
// **** Animation Conditions **** //
// * These are extra conditions you can put on creatures with ambient
// * animations.
// * Civilized creatures interact with placeables in
// * their area that have the tag "NW_INTERACTIVE"
// * and "talk" to each other.
// *
// * Humanoid races are civilized by default, so only
// * set this flag for monster races that you want to
// * behave the same way.
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
// * If this flag is set, this creature will constantly
// * be acting. Otherwise, creatures will only start
// * performing their ambient animations when they
// * first perceive a player, and they will stop when
// * the player moves away.
// SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// * Civilized creatures with this flag set will
// * randomly use a few voicechats. It's a good
// * idea to avoid putting this on multiple
// * creatures using the same voiceset.
SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// * Creatures with _immobile_ ambient animations
// * can have this flag set to make them mobile in a
// * close range. They will never leave their immediate
// * area, but will move around in it, frequently
// * returning to their starting point.
// *
// * Note that creatures spawned inside interior areas
// * that contain a waypoint with one of the tags
// * "NW_HOME", "NW_TAVERN", "NW_SHOP" will automatically
// * have this condition set.
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
//: ANIMATIONS
/******************************************************************************/
/******************************************************************************/
//: MANUAL ROLES
/*
Note: The roles are in the order of priority so if an NPC is marked
as a healer they will try and heal first, if no one needs a heal
then they will do any other role below that until they run out
of roles and attempt a physical attack.
Casters ARE Automatically Set Up by this AI and depends upon what spells
have been given to them! Keep this in mind. The Roles Set Below ADD Flavor
to the Caster and FORCE allow more selections...which could be unintended.
Note: You can use more than 1 of these but the AI may get a little
confused if you do. Try to use only 1 or something complimentary
*/
//* If an npc has healer selected they will heal as a priority, then follow
//* whatever other roles are switched on.
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_HEALER") == 1)
SetBattleCondition(OAI_ROLE_HEALER);
//* After healing they have 1/4 chance to use monster abilities if they have them,
//* even if assigned other roles...
//* A buffer will apply buffs to any group members that request them.
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_BUFFER") == 1)
SetBattleCondition(OAI_ROLE_BUFFER);
//* An aoe specialist can be deadly to both sides, but is pretty good at
//* hitting only enemies. The aoe code uses a bit of math to determine the
//* best location, so is usually very deadly.
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_AOE_SPECIALIST") == 1)
SetBattleCondition(OAI_ROLE_AOE_SPECIALIST);
//* A status caster will attempt to put status ailments on enemies to slow
//* Things down. They will also try to dispell and keep targets clean for the
//* Melee attackers.
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_STATUS_CASTER") == 1)
SetBattleCondition(OAI_ROLE_STATUS_CASTER);
//* An attack caster casts single target or safe aoe attack spells. They will
//* use dangerous aoe spells if they run out of safe spells
if (GetLocalInt(OBJECT_SELF, "OAI_ROLE_ATTACK_CASTER") == 1)
SetBattleCondition(OAI_ROLE_ATTACK_CASTER);
//: MANUAL ROLES
/******************************************************************************/
/******************************************************************************/
//: EVENTS (Not used in OAI but left for Custom User Defined Events)
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
//: EVENTS
/******************************************************************************/
/******************************************************************************/
//: MAIN SETUP
// * LEAVE THESE ALONE!!
//Sets up the Shouts the NPC Will Listen To
SetListeningPatterns();
//Sets up Personal Characteristics of Each NPC
WhoAmI();
//: MAIN SETUP
/******************************************************************************/
/******************************************************************************/
//: POST SPAWN ADDITONS BELOW HERE
//: POST SPAWN ADDITONS ABOVE HERE
/******************************************************************************/
DelayCommand(2.0, WalkWayPoints());// Delayed walk waypoints, as to not upset instant combat spawning.
// This will also check if to change to day/night posts during the
// walking, no heartbeats.
}

5028
_removed/nw_i0_generic.nss Normal file

File diff suppressed because it is too large Load Diff

898
_removed/nw_i0_spells.nss Normal file
View File

@@ -0,0 +1,898 @@
//::///////////////////////////////////////////////
//:: Spells Include
//:: NW_I0_SPELLS
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 2, 2002
//:: Updated By: 2003/20/10 Georg Zoeller
//:://////////////////////////////////////////////
//:: modifications by mr_bumpkin on dec 4, 2003
//::
//:: changed caster level calculations in 2 places to reflect prc caster levels.
//:: changed MyResistSpell to MyPRCResistSpell in the spellsCure section.
//Added code into spellsCure to maximize for Faith Healing and Blast Infidel
//Aaon Graywolf - Jan 6, 2003
#include "prc_inc_function"
#include "inc_dispel"
// GZ: Number of spells in GetSpellBreachProtections
const int NW_I0_SPELLS_MAX_BREACH = 33;
// * Function for doing electrical traps
void TrapDoElectricalDamage(int ngDamageMaster, int nSaveDC, int nSecondary);
// * 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);
// * Used to route the saving throws through this function to check for spell countering by a saving throw.
// Returns: 0 if the saving throw roll failed
// Returns: 1 if the saving throw roll succeeded
// Returns: 2 if the target was immune to the save type specified
// Note: If used within an Area of Effect Object Script (On Enter, OnExit, OnHeartbeat), you MUST pass
// GetAreaOfEffectCreator() into oSaveVersus!! \
int MySavingThrow(int nSavingThrow, object oTarget, int nDC, int nSaveType=SAVING_THROW_TYPE_NONE, object oSaveVersus = OBJECT_SELF, float fDelay = 0.0);
// * Will pass back a linked effect for all the protection from alignment spells. The power represents the multiplier of strength.
// * That is instead of +3 AC and +2 Saves a power of 2 will yield +6 AC and +4 Saves.
effect CreateProtectionFromAlignmentLink(int nAlignment, int nPower = 1);
// * Will pass back a linked effect for all of the doom effects.
effect CreateDoomEffectsLink();
// * Searchs through a persons effects and removes those from a particular spell by a particular caster.
void RemoveSpellEffects(int nSpell_ID, object oCaster, object oTarget);
// * Searchs through a persons effects and removes all those of a specific type.
void RemoveSpecificEffect(int nEffectTypeID, object oTarget);
// * Returns the time in seconds that the effect should be delayed before application.
float GetSpellEffectDelay(location SpellTargetLocation, object oTarget);
// * This allows the application of a random delay to effects based on time parameters passed in. Min default = 0.4, Max default = 1.1
float GetRandomDelay(float fMinimumTime = 0.4, float MaximumTime = 1.1);
// * Get Difficulty Duration
int GetScaledDuration(int nActualDuration, object oTarget);
// * Get Scaled Effect
effect GetScaledEffect(effect eStandard, object oTarget);
// * Remove all spell protections of a specific type
int RemoveProtections(int nSpell_ID, object oTarget, int nCount);
// * Performs a spell breach up to nTotal spells are removed and nSR spell
// * resistance is lowered.
int GetSpellBreachProtection(int nLastChecked);
//* Assigns a debug string to the Area of Effect Creator
void AssignAOEDebugString(string sString);
// * Plays a random dragon battlecry based on age.
void PlayDragonBattleCry();
// * Returns true if Target is a humanoid
int AmIAHumanoid(object oTarget);
// * Performs a spell breach up to nTotal spell are removed and
// * nSR spell resistance is lowered. nSpellId can be used to override
// * the originating spell ID. If not specified, SPELL_GREATER_SPELL_BREACH
// * is used
void DoSpellBreach(object oTarget, int nTotal, int nSR, int nSpellId = -1);
// * Returns true if Target is a humanoid
int AmIAHumanoid(object oTarget)
{
int nRacial = MyPRCGetRacialType(oTarget);
if((nRacial == RACIAL_TYPE_DWARF) ||
(nRacial == RACIAL_TYPE_HALFELF) ||
(nRacial == RACIAL_TYPE_HALFORC) ||
(nRacial == RACIAL_TYPE_ELF) ||
(nRacial == RACIAL_TYPE_GNOME) ||
(nRacial == RACIAL_TYPE_HUMANOID_GOBLINOID) ||
(nRacial == RACIAL_TYPE_HALFLING) ||
(nRacial == RACIAL_TYPE_HUMAN) ||
(nRacial == RACIAL_TYPE_HUMANOID_MONSTROUS) ||
(nRacial == RACIAL_TYPE_HUMANOID_ORC) ||
(nRacial == RACIAL_TYPE_HUMANOID_REPTILIAN))
{
return TRUE;
}
return FALSE;
}
//::///////////////////////////////////////////////
//:: spellsCure
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Used by the 'cure' series of spells.
Will do max heal/damage if at normal or low
difficulty.
Random rolls occur at higher difficulties.
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
void spellsCure(int nDamage, int nMaxExtraDamage, int nMaximized, int vfx_impactHurt, int vfx_impactHeal, int nSpellID ,int ModCasterlevel = 0)
{
//Declare major variables
object oTarget = GetSpellTargetObject();
int nHeal;
int nMetaMagic = GetMetaMagicFeat();
effect eVis = EffectVisualEffect(vfx_impactHurt);
effect eVis2 = EffectVisualEffect(vfx_impactHeal);
effect eHeal, eDam;
int CasterLvl;
if ( ModCasterlevel == 0)
CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
else
CasterLvl = ModCasterlevel;
int nExtraDamage = CasterLvl; // * figure out the bonus damage
if (nExtraDamage > nMaxExtraDamage)
{
nExtraDamage = nMaxExtraDamage;
}
// * if low or normal difficulty is treated as MAXIMIZED
if(GetIsPC(oTarget) && GetGameDifficulty() < GAME_DIFFICULTY_CORE_RULES)
{
nDamage = nMaximized + nExtraDamage;
}
else
{
nDamage = nDamage + nExtraDamage;
}
//Make metamagic checks
int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_POSITIVE, TRUE);
if (nMetaMagic == METAMAGIC_MAXIMIZE || iBlastFaith)
{
nDamage = 8 + nExtraDamage;
// * if low or normal difficulty then MAXMIZED is doubled.
if(GetIsPC(OBJECT_SELF) && GetGameDifficulty() < GAME_DIFFICULTY_CORE_RULES)
{
nDamage = nDamage + nExtraDamage;
}
}
if (nMetaMagic == METAMAGIC_EMPOWER || GetHasFeat(FEAT_HEALING_DOMAIN_POWER))
{
nDamage = nDamage + (nDamage/2);
}
if (MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
//Figure out the amount of damage to heal
nHeal = nDamage;
//Set the heal effect
eHeal = EffectHeal(nHeal);
//Apply heal effect and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID, FALSE));
}
//Check that the target is undead
else
{
int nTouch = TouchAttackMelee(oTarget);
if (nTouch > 0)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID));
if (!MyPRCResistSpell(OBJECT_SELF, oTarget,CasterLvl+SPGetPenetr()))
{
eDam = EffectDamage(nDamage,DAMAGE_TYPE_NEGATIVE);
//Apply the VFX impact and effects
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}
}
}
//::///////////////////////////////////////////////
//:: DoSpelLBreach
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Performs a spell breach up to nTotal spells
are removed and nSR spell resistance is
lowered.
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: September 2002
//:: Modified : Georg, Oct 31, 2003
//:://////////////////////////////////////////////
void DoSpellBreach(object oTarget, int nTotal, int nSR, int nSpellId = -1)
{
if (nSpellId == -1)
{
nSpellId = SPELL_GREATER_SPELL_BREACH;
}
effect eSR = EffectSpellResistanceDecrease(nSR);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVis = EffectVisualEffect(VFX_IMP_BREACH);
int nCnt, nIdx;
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellId ));
//Search through and remove protections.
while(nCnt <= NW_I0_SPELLS_MAX_BREACH && nIdx < nTotal)
{
nIdx = nIdx + RemoveProtections(GetSpellBreachProtection(nCnt), oTarget, nCnt);
nCnt++;
}
effect eLink = EffectLinkEffects(eDur, eSR);
//--------------------------------------------------------------------------
// This can not be dispelled
//--------------------------------------------------------------------------
eLink = ExtraordinaryEffect(eLink);
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(10),TRUE);
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
//::///////////////////////////////////////////////
//:: GetDragonFearDC
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Adding a function, we were using two different
sets of numbers before. Standardizing it to be
closer to 3e.
nAge - hit dice
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: Sep 13, 2002
//:://////////////////////////////////////////////
int GetDragonFearDC(int nAge)
{
//hmm... not sure what's up with all these nCount variables, they're not
//actually used... so I'm gonna comment them out
int nDC = 13;
// int nCount = 1;
//Determine the duration and save DC
//wyrmling meant no change from default, so we don't need it
/*
if (nAge <= 6) //Wyrmling
{
nDC = 13;
nCount = 1;
}
else
*/
if (nAge >= 7 && nAge <= 9) //Very Young
{
nDC = 15;
// nCount = 2;
}
else if (/*nAge >= 10 &&*/ nAge <= 12) //Young
{
nDC = 17;
// nCount = 3;
}
else if (/*nAge >= 13 &&*/ nAge <= 15) //Juvenile
{
nDC = 19;
// nCount = 4;
}
else if (/*nAge >= 16 &&*/ nAge <= 18) //Young Adult
{
nDC = 21;
// nCount = 5;
}
else if (/*nAge >= 19 &&*/ nAge <= 21) //Adult
{
nDC = 24;
// nCount = 6;
}
else if (/*nAge >= 22 &&*/ nAge <= 24) //Mature Adult
{
nDC = 27;
// nCount = 7;
}
else if (/*nAge >= 25 &&*/ nAge <= 27) //Old
{
nDC = 28;
// nCount = 8;
}
else if (/*nAge >= 28 &&*/ nAge <= 30) //Very Old
{
nDC = 30;
// nCount = 9;
}
else if (/*nAge >= 31 &&*/ nAge <= 33) //Ancient
{
nDC = 32;
// nCount = 10;
}
else if (/*nAge >= 34 &&*/ nAge <= 37) //Wyrm
{
nDC = 34;
// nCount = 11;
}
else if (nAge > 37) //Great Wyrm
{
nDC = 37;
// nCount = 12;
}
return nDC;
}
//------------------------------------------------------------------------------
// Kovi function: calculates the appropriate base number of attacks
// for spells that increase this (tensers, divine power)
//------------------------------------------------------------------------------
int CalcNumberOfAttacks()
{
//int n = PRCGetCasterLevel(OBJECT_SELF);
//int nBAB1 = GetLevelByClass(CLASS_TYPE_RANGER)
// + GetLevelByClass(CLASS_TYPE_FIGHTER)
// + GetLevelByClass(CLASS_TYPE_PALADIN)
// + GetLevelByClass(CLASS_TYPE_BARBARIAN);
//int nBAB2 = GetLevelByClass(CLASS_TYPE_DRUID)
// + GetLevelByClass(CLASS_TYPE_MONK)
// + GetLevelByClass(CLASS_TYPE_ROGUE)
// + GetLevelByClass(CLASS_TYPE_BARD);
//int nBAB3 = GetLevelByClass(CLASS_TYPE_WIZARD)
// + GetLevelByClass(CLASS_TYPE_SORCERER);
//int nOldBAB = nBAB1 + (nBAB2 + n) * 3 / 4 + nBAB3 / 2;
//int nNewBAB = nBAB1 + n + nBAB2 * 3 / 4 + nBAB3 / 2;
//if (nNewBAB / 5 > nOldBAB / 5)
// return 2; // additional attack
//else
// return 1; // everything is normal
// Oni5115
// This calculates bonus attacks based on Total Hit Dice
// regardless of classes. It effectively gives you
// the proper bonus attacks based on a fighter's level.
int iBAB = GetBaseAttackBonus(OBJECT_SELF);
int iCharLevel = GetHitDice(OBJECT_SELF);
int iTemp = GetHitDice(OBJECT_SELF);
// if character is over 20, remove all BaB gained past level 20
// because you do not gain more attacks after 20.
if (iTemp > 20)
{
iTemp -= 20;
iTemp /= 2;
iBAB -= iTemp;
iCharLevel = 20;
}
int iNormalAttacks = ( (iBAB - 1) / 5 ) + 1;
int iFighterAttacks = ( (iCharLevel - 1) / 5 ) + 1;
return (iFighterAttacks - iNormalAttacks);
}
//------------------------------------------------------------------------------
// GZ: gets rids of temporary hit points so that they will not stack
//------------------------------------------------------------------------------
void RemoveTempHitPoints()
{
effect eProtection;
int nCnt = 0;
eProtection = GetFirstEffect(OBJECT_SELF);
while (GetIsEffectValid(eProtection))
{
if(GetEffectType(eProtection) == EFFECT_TYPE_TEMPORARY_HITPOINTS)
RemoveEffect(OBJECT_SELF, eProtection);
eProtection = GetNextEffect(OBJECT_SELF);
}
}
// * Kovi. removes any effects from this type of spell
// * i.e., used in Mage Armor to remove any previous
// * mage armors
void RemoveEffectsFromSpell(object oTarget, int SpellID)
{
effect eLook = GetFirstEffect(oTarget);
while (GetIsEffectValid(eLook)) {
if (GetEffectSpellId(eLook) == SpellID)
RemoveEffect(oTarget, eLook);
eLook = GetNextEffect(oTarget);
}
}
int MyResistSpell(object oCaster, object oTarget, float fDelay = 0.0)
{
if (fDelay > 0.5)
{
fDelay = fDelay - 0.1;
}
int nResist = ResistSpell(oCaster, oTarget);
effect eSR = EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE);
effect eGlobe = EffectVisualEffect(VFX_IMP_GLOBE_USE);
effect eMantle = EffectVisualEffect(VFX_IMP_SPELL_MANTLE_USE);
if(nResist == 1) //Spell Resistance
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eSR, oTarget));
}
else if(nResist == 2) //Globe
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGlobe, oTarget));
}
else if(nResist == 3) //Spell Mantle
{
if (fDelay > 0.5)
{
fDelay = fDelay - 0.1;
}
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eMantle, oTarget));
}
return nResist;
}
int MySavingThrow(int nSavingThrow, object oTarget, int nDC, int nSaveType=SAVING_THROW_TYPE_NONE, object oSaveVersus = OBJECT_SELF, float fDelay = 0.0)
{
// -------------------------------------------------------------------------
// GZ: sanity checks to prevent wrapping around
// -------------------------------------------------------------------------
if (nDC<1)
{
nDC = 1;
}
else if (nDC > 255)
{
nDC = 255;
}
effect eVis;
int bValid = FALSE;
int nSpellID;
if(nSavingThrow == SAVING_THROW_FORT)
{
bValid = FortitudeSave(oTarget, nDC, nSaveType, oSaveVersus);
if(bValid == 1)
{
eVis = EffectVisualEffect(VFX_IMP_FORTITUDE_SAVING_THROW_USE);
}
}
else if(nSavingThrow == SAVING_THROW_REFLEX)
{
bValid = ReflexSave(oTarget, nDC, nSaveType, oSaveVersus);
if(bValid == 1)
{
eVis = EffectVisualEffect(VFX_IMP_REFLEX_SAVE_THROW_USE);
}
}
else if(nSavingThrow == SAVING_THROW_WILL)
{
bValid = WillSave(oTarget, nDC, nSaveType, oSaveVersus);
if(bValid == 1)
{
eVis = EffectVisualEffect(VFX_IMP_WILL_SAVING_THROW_USE);
}
}
nSpellID = GetSpellId();
/*
return 0 = FAILED SAVE
return 1 = SAVE SUCCESSFUL
return 2 = IMMUNE TO WHAT WAS BEING SAVED AGAINST
*/
if(bValid == 0)
{
if((nSaveType == SAVING_THROW_TYPE_DEATH
|| nSpellID == SPELL_WEIRD
|| nSpellID == SPELL_FINGER_OF_DEATH) &&
nSpellID != SPELL_HORRID_WILTING)
{
eVis = EffectVisualEffect(VFX_IMP_DEATH);
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//redundant comparison on bValid, let's move the eVis line down below
/* if(bValid == 2)
{
eVis = EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE);
}*/
if(bValid == 1 || bValid == 2)
{
if(bValid == 2)
{
eVis = EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE);
/*
If the spell is save immune then the link must be applied in order to get the true immunity
to be resisted. That is the reason for returing false and not true. True blocks the
application of effects.
*/
bValid = FALSE;
}
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
return bValid;
}
effect CreateProtectionFromAlignmentLink(int nAlignment, int nPower = 1)
{
int nFinal = nPower * 2;
effect eAC = EffectACIncrease(nFinal, AC_DEFLECTION_BONUS);
eAC = VersusAlignmentEffect(eAC, ALIGNMENT_ALL, nAlignment);
effect eSave = EffectSavingThrowIncrease(SAVING_THROW_ALL, nFinal);
eSave = VersusAlignmentEffect(eSave,ALIGNMENT_ALL, nAlignment);
effect eImmune = EffectImmunity(IMMUNITY_TYPE_MIND_SPELLS);
eImmune = VersusAlignmentEffect(eImmune,ALIGNMENT_ALL, nAlignment);
effect eDur;
if(nAlignment == ALIGNMENT_EVIL)
{
eDur = EffectVisualEffect(VFX_DUR_PROTECTION_GOOD_MINOR);
}
else if(nAlignment == ALIGNMENT_GOOD)
{
eDur = EffectVisualEffect(VFX_DUR_PROTECTION_EVIL_MINOR);
}
effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eLink = EffectLinkEffects(eImmune, eSave);
eLink = EffectLinkEffects(eLink, eAC);
eLink = EffectLinkEffects(eLink, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
return eLink;
}
effect CreateDoomEffectsLink()
{
//Declare major variables
effect eSaves = EffectSavingThrowDecrease(SAVING_THROW_ALL, 2);
effect eAttack = EffectAttackDecrease(2);
effect eDamage = EffectDamageDecrease(2);
effect eSkill = EffectSkillDecrease(SKILL_ALL_SKILLS, 2);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eAttack, eDamage);
eLink = EffectLinkEffects(eLink, eSaves);
eLink = EffectLinkEffects(eLink, eSkill);
eLink = EffectLinkEffects(eLink, eDur);
return eLink;
}
void RemoveSpellEffects(int nSpell_ID, object oCaster, object oTarget)
{
//Declare major variables
int bValid = FALSE;
effect eAOE;
if(GetHasSpellEffect(nSpell_ID, oTarget))
{
//Search through the valid effects on the target.
eAOE = GetFirstEffect(oTarget);
while (GetIsEffectValid(eAOE) && bValid == FALSE)
{
if (GetEffectCreator(eAOE) == oCaster)
{
//If the effect was created by the spell then remove it
if(GetEffectSpellId(eAOE) == nSpell_ID)
{
RemoveEffect(oTarget, eAOE);
bValid = TRUE;
}
}
//Get next effect on the target
eAOE = GetNextEffect(oTarget);
}
}
}
void RemoveSpecificEffect(int nEffectTypeID, object oTarget)
{
//Declare major variables
//Get the object that is exiting the AOE
int bValid = FALSE;
effect eAOE;
//Search through the valid effects on the target.
eAOE = GetFirstEffect(oTarget);
while (GetIsEffectValid(eAOE))
{
if (GetEffectType(eAOE) == nEffectTypeID)
{
//If the effect was created by the spell then remove it
bValid = TRUE;
RemoveEffect(oTarget, eAOE);
}
//Get next effect on the target
eAOE = GetNextEffect(oTarget);
}
}
float GetSpellEffectDelay(location SpellTargetLocation, object oTarget)
{
float fDelay;
return fDelay = GetDistanceBetweenLocations(SpellTargetLocation, GetLocation(oTarget))/20;
}
float GetRandomDelay(float fMinimumTime = 0.4, float MaximumTime = 1.1)
{
float fRandom = MaximumTime - fMinimumTime;
int nRandom;
if(fRandom < 0.0)
{
return 0.0;
}
else
{
nRandom = FloatToInt(fRandom * 10.0);
nRandom = Random(nRandom) + 1;
fRandom = IntToFloat(nRandom);
fRandom /= 10.0;
return fRandom + fMinimumTime;
}
}
int GetScaledDuration(int nActualDuration, object oTarget)
{
int nDiff = GetGameDifficulty();
int nNew = nActualDuration;
if(GetIsPC(oTarget) && nActualDuration > 3)
{
if(nDiff == GAME_DIFFICULTY_VERY_EASY || nDiff == GAME_DIFFICULTY_EASY)
{
nNew = nActualDuration / 4;
}
else if(nDiff == GAME_DIFFICULTY_NORMAL)
{
nNew = nActualDuration / 2;
}
if(nNew == 0)
{
nNew = 1;
}
}
return nNew;
}
effect GetScaledEffect(effect eStandard, object oTarget)
{
int nDiff = GetGameDifficulty();
effect eNew = eStandard;
object oMaster = GetMaster(oTarget);
if(GetIsPC(oTarget) || (GetIsObjectValid(oMaster) && GetIsPC(oMaster)))
{
if(GetEffectType(eStandard) == EFFECT_TYPE_FRIGHTENED && nDiff == GAME_DIFFICULTY_VERY_EASY)
{
eNew = EffectAttackDecrease(-2);
return eNew;
}
if(GetEffectType(eStandard) == EFFECT_TYPE_FRIGHTENED && nDiff == GAME_DIFFICULTY_EASY)
{
eNew = EffectAttackDecrease(-4);
return eNew;
}
if(nDiff == GAME_DIFFICULTY_VERY_EASY &&
(GetEffectType(eStandard) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eStandard) == EFFECT_TYPE_STUNNED ||
GetEffectType(eStandard) == EFFECT_TYPE_CONFUSED))
{
eNew = EffectDazed();
return eNew;
}
else if(GetEffectType(eStandard) == EFFECT_TYPE_CHARMED || GetEffectType(eStandard) == EFFECT_TYPE_DOMINATED)
{
eNew = EffectDazed();
return eNew;
}
}
return eNew;
}
int RemoveProtections(int nSpell_ID, object oTarget, int nCount)
{
//Declare major variables
effect eProtection;
int nCnt = 0;
if(GetHasSpellEffect(nSpell_ID, oTarget))
{
//Search through the valid effects on the target.
eProtection = GetFirstEffect(oTarget);
while (GetIsEffectValid(eProtection))
{
//If the effect was created by the spell then remove it
if(GetEffectSpellId(eProtection) == nSpell_ID)
{
RemoveEffect(oTarget, eProtection);
//return 1;
nCnt++;
}
//Get next effect on the target
eProtection = GetNextEffect(oTarget);
}
}
if(nCnt > 0)
{
return 1;
}
else
{
return 0;
}
}
//------------------------------------------------------------------------------
// Returns the nLastChecked-nth highest spell on the creature for use in
// the spell breach routines
// Please modify the constatn NW_I0_SPELLS_MAX_BREACH at the top of this file
// if you change the number of spells.
//------------------------------------------------------------------------------
int GetSpellBreachProtection(int nLastChecked)
{
//--------------------------------------------------------------------------
// GZ: Protections are stripped in the order they appear here
//--------------------------------------------------------------------------
if(nLastChecked == 1) {return SPELL_GREATER_SPELL_MANTLE;}
else if (nLastChecked == 2){return SPELL_PREMONITION;}
else if(nLastChecked == 3) {return SPELL_SPELL_MANTLE;}
else if(nLastChecked == 4) {return SPELL_SHADOW_SHIELD;}
else if(nLastChecked == 5) {return SPELL_GREATER_STONESKIN;}
else if(nLastChecked == 6) {return SPELL_ETHEREAL_VISAGE;}
else if(nLastChecked == 7) {return SPELL_GLOBE_OF_INVULNERABILITY;}
else if(nLastChecked == 8) {return SPELL_ENERGY_BUFFER;}
else if(nLastChecked == 9) {return 443;} // greater sanctuary
else if(nLastChecked == 10) {return SPELL_MINOR_GLOBE_OF_INVULNERABILITY;}
else if(nLastChecked == 11) {return SPELL_SPELL_RESISTANCE;}
else if(nLastChecked == 12) {return SPELL_STONESKIN;}
else if(nLastChecked == 13) {return SPELL_LESSER_SPELL_MANTLE;}
else if(nLastChecked == 14) {return SPELL_MESTILS_ACID_SHEATH;}
else if(nLastChecked == 15) {return SPELL_MIND_BLANK;}
else if(nLastChecked == 16) {return SPELL_ELEMENTAL_SHIELD;}
else if(nLastChecked == 17) {return SPELL_PROTECTION_FROM_SPELLS;}
else if(nLastChecked == 18) {return SPELL_PROTECTION_FROM_ELEMENTS;}
else if(nLastChecked == 19) {return SPELL_RESIST_ELEMENTS;}
else if(nLastChecked == 20) {return SPELL_DEATH_ARMOR;}
else if(nLastChecked == 21) {return SPELL_GHOSTLY_VISAGE;}
else if(nLastChecked == 22) {return SPELL_ENDURE_ELEMENTS;}
else if(nLastChecked == 23) {return SPELL_SHADOW_SHIELD;}
else if(nLastChecked == 24) {return SPELL_SHADOW_CONJURATION_MAGE_ARMOR;}
else if(nLastChecked == 25) {return SPELL_NEGATIVE_ENERGY_PROTECTION;}
else if(nLastChecked == 26) {return SPELL_SANCTUARY;}
else if(nLastChecked == 27) {return SPELL_MAGE_ARMOR;}
else if(nLastChecked == 28) {return SPELL_STONE_BONES;}
else if(nLastChecked == 29) {return SPELL_SHIELD;}
else if(nLastChecked == 30) {return SPELL_SHIELD_OF_FAITH;}
else if(nLastChecked == 31) {return SPELL_LESSER_MIND_BLANK;}
else if(nLastChecked == 32) {return SPELL_IRONGUTS;}
else if(nLastChecked == 33) {return SPELL_RESISTANCE;}
return nLastChecked;
}
void AssignAOEDebugString(string sString)
{
object oTarget = GetAreaOfEffectCreator();
AssignCommand(oTarget, SpeakString(sString));
}
void PlayDragonBattleCry()
{
if(d100() > 50)
{
PlayVoiceChat(VOICE_CHAT_BATTLECRY1);
}
else
{
PlayVoiceChat(VOICE_CHAT_BATTLECRY2);
}
}
void TrapDoElectricalDamage(int ngDamageMaster, int nSaveDC, int nSecondary)
{
//Declare major variables
object oTarget = GetEnteringObject();
object o2ndTarget;
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oTarget, BODY_NODE_CHEST);
int nDamageMaster = ngDamageMaster;
int nDamage = nDamageMaster;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
location lTarget = GetLocation(oTarget);
int nCount = 0;
//Adjust the trap damage based on the feats of the target
if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nSaveDC, SAVING_THROW_TYPE_TRAP))
{
if (GetHasFeat(FEAT_IMPROVED_EVASION, oTarget))
{
nDamage /= 2;
}
}
else if (GetHasFeat(FEAT_EVASION, oTarget) || GetHasFeat(FEAT_IMPROVED_EVASION, oTarget))
{
nDamage = 0;
}
else
{
nDamage /= 2;
}
if (nDamage > 0)
{
eDam = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
//Reset the damage;
nDamage = nDamageMaster;
o2ndTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lTarget);
while (GetIsObjectValid(o2ndTarget) && nCount <= nSecondary)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//check to see that the original target is not hit again.
if(o2ndTarget != oTarget)
{
//Adjust the trap damage based on the feats of the target
if(!PRCMySavingThrow(SAVING_THROW_REFLEX, o2ndTarget, nSaveDC, SAVING_THROW_TYPE_ELECTRICITY))
{
if (GetHasFeat(FEAT_IMPROVED_EVASION, o2ndTarget))
{
nDamage /= 2;
}
}
else if (GetHasFeat(FEAT_EVASION, o2ndTarget) || GetHasFeat(FEAT_IMPROVED_EVASION, o2ndTarget))
{
nDamage = 0;
}
else
{
nDamage /= 2;
}
if (nDamage > 0)
{
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
//Apply the VFX impact and damage effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, o2ndTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, o2ndTarget);
//Connect the lightning stream from one target to another.
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLightning, o2ndTarget, 0.75);
//Set the last target as the new start for the lightning stream
eLightning = EffectBeam(VFX_BEAM_LIGHTNING, o2ndTarget, BODY_NODE_CHEST);
}
}
//Reset the damage
nDamage = nDamageMaster;
//Increment the count
nCount++;
}
//Get next target in the shape.
o2ndTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lTarget);
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,27 @@
//::///////////////////////////////////////////////
//:: General Treasure Spawn Script Medium
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Spawns in general purpose treasure, usable
by all classes.
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: February 26 2001
//:://////////////////////////////////////////////
#include "NW_O2_CONINCLUDE"
void main()
{
if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
{
return;
}
object oLastOpener = GetLastOpener();
GenerateMediumTreasure(oLastOpener, OBJECT_SELF);
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
DelayCommand(3600.0, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0));
ShoutDisturbed();
}

BIN
_removed/nw_s0_curcrwn.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,49 @@
//::///////////////////////////////////////////////
//:: Cure Critical Wounds
//:: NW_S0_CurCrWn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// As cure light wounds, except cure critical wounds
// cures 4d8 points of damage plus 1 point per
// caster level (up to +20).
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: Oct 18, 2000
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 20, 2001
//:: Update Pass By: Preston W, On: July 26, 2001
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
spellsCure(d8(4), 20, 32, VFX_IMP_SUNSTRIKE, VFX_IMP_HEALING_G, GetSpellId());
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

BIN
_removed/nw_s0_curlgtw.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,51 @@
//::///////////////////////////////////////////////
//:: Cure Light Wounds
//:: NW_S0_CurLgtW
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// When laying your hand upon a living creature,
// you channel positive energy that cures 1d8 points
// of damage plus 1 point per caster level (up to +5).
// Since undead are powered by negative energy, this
// spell inflicts damage on them instead of curing
// their wounds. An undead creature can attempt a
// Will save to take half damage.
*/
//:://////////////////////////////////////////////
//:: Created By: Brennon Holmes
//:: Created On: Oct 12, 2000
//:://////////////////////////////////////////////
//:: Update Pass By: Preston W, On: July 26, 2001
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
spellsCure(d8(), 5, 8, VFX_IMP_SUNSTRIKE, VFX_IMP_HEALING_S, GetSpellId());
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

BIN
_removed/nw_s0_curminw.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,46 @@
//::///////////////////////////////////////////////
//:: Cure Minor Wounds
//:: NW_S0_CurMinW
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// As cure light wounds, except cure minor wounds
// cures only 1 point of damage
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: Oct 18, 2000
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: Feb 22, 2001
//:: Last Updated By: Preston Watamaniuk, On: April 6, 2001
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
spellsCure(4, 0, 4, VFX_IMP_SUNSTRIKE, VFX_IMP_HEAD_HEAL, GetSpellId());
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

BIN
_removed/nw_s0_curmodw.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,47 @@
//::///////////////////////////////////////////////
//:: Cure Moderate Wounds
//:: NW_S0_CurModW
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// As cure light wounds, except cure moderate wounds
// cures 2d8 points of damage plus 1 point per
// caster level (up to +10).
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: Oct 18, 2001
//:://////////////////////////////////////////////
//:: Update Pass By: Preston W, On: July 25, 2001
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
spellsCure(d8(2), 10, 16, VFX_IMP_SUNSTRIKE, VFX_IMP_HEALING_M, GetSpellId());
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

BIN
_removed/nw_s0_curserw.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,46 @@
//::///////////////////////////////////////////////
//:: Cure Serious Wounds
//:: NW_S0_CurSerW
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// As cure light wounds, except cure moderate wounds
// cures 3d8 points of damage plus 1 point per caster
// level (up to +15).
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: Oct 18, 2000
//:://////////////////////////////////////////////
//:: Update Pass By: Preston W, On: July 25, 2001
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
spellsCure(d8(3), 15, 24, VFX_IMP_SUNSTRIKE, VFX_IMP_HEALING_L, GetSpellId());
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

Binary file not shown.

View File

@@ -0,0 +1,92 @@
//::///////////////////////////////////////////////
//:: Darkness: On Enter
//:: NW_S0_DarknessA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates a globe of darkness around those in the area
of effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Feb 28, 2002
//:://////////////////////////////////////////////
//:: modified by mr_bumpkin Dec 4, 2003
#include "spinc_common"
#include "x0_i0_spells"
#include "prc_class_const"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
ActionDoCommand(SetAllAoEInts(SPELL_DARKNESS ,OBJECT_SELF, GetSpellSaveDC()));
int nMetaMagic = GetMetaMagicFeat();
effect eInvis = EffectInvisibility(INVISIBILITY_TYPE_DARKNESS);
effect eDark = EffectDarkness();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eDark, eDur);
effect eLink2 = EffectLinkEffects(eInvis, eDur);
object oTarget = GetEnteringObject();
int iShadow = GetLevelByClass(CLASS_TYPE_SHADOWLORD,oTarget);
if (iShadow)
SPApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectUltravision(), oTarget,0.0f,FALSE);
if (iShadow>1)
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectConcealment(20), oTarget,0.0f,FALSE);
int nDuration = PRCGetCasterLevel(OBJECT_SELF);
//Enter Metamagic conditions
if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND))
{
nDuration = nDuration *2; //Duration is +100%
}
// * July 2003: If has darkness then do not put it on it again
if (GetHasEffect(EFFECT_TYPE_DARKNESS, oTarget) == TRUE)
{
return;
}
if(GetIsObjectValid(oTarget) && oTarget != GetAreaOfEffectCreator())
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
}
else
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE));
}
if (iShadow)
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink2, oTarget,0.0f,FALSE);
else
//Fire cast spell at event for the specified target
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget,0.0f,FALSE);
}
else if (oTarget == GetAreaOfEffectCreator())
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE));
//Fire cast spell at event for the specified target
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink2, oTarget,0.0f,FALSE);
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

Binary file not shown.

View File

@@ -0,0 +1,51 @@
//::///////////////////////////////////////////////
//:: Darkness: On Exit
//:: NW_S0_DarknessB.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates a globe of darkness around those in the area
of effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Feb 28, 2002
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "prc_feat_const"
#include "x2_inc_spellhook"
#include "spinc_common"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
ActionDoCommand(SetAllAoEInts(SPELL_DARKNESS ,OBJECT_SELF, GetSpellSaveDC()));
object oTarget = GetExitingObject();
object oCreator = GetAreaOfEffectCreator();
int bValid = FALSE;
effect eAOE;
//Search through the valid effects on the target.
eAOE = GetFirstEffect(oTarget);
while (GetIsEffectValid(eAOE))
{
int nID = GetEffectSpellId(eAOE);
if( nID== SPELL_DARKNESS || nID == SPELLABILITY_AS_DARKNESS || nID == SPELL_SHADOW_CONJURATION_DARKNESS || nID == 688 || nID ==SHADOWLORD_DARKNESS || nID == SPELL_RACE_DARKNESS)
{
if (GetEffectCreator(eAOE) == oCreator)
RemoveEffect(oTarget, eAOE);
}
//Get next effect on the target
eAOE = GetNextEffect(oTarget);
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

BIN
_removed/nw_s0_harm.ncs Normal file

Binary file not shown.

107
_removed/nw_s0_harm.nss Normal file
View File

@@ -0,0 +1,107 @@
//::///////////////////////////////////////////////
//:: [Harm]
//:: [NW_S0_Harm.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Reduces target to 1d4 HP on successful touch
//:: attack. If the target is undead it is healed.
//:://////////////////////////////////////////////
//:: Created By: Keith Soleski
//:: Created On: Jan 18, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 20, 2001
//:: Update Pass By: Preston W, On: Aug 1, 2001
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
//::Added code to maximize for Faith Healing and Blast Infidel
//::Aaon Graywolf - Jan 7, 2004
#include "spinc_common"
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
int nDamage, nHeal;
int nMetaMagic = GetMetaMagicFeat();
int nTouch = TouchAttackMelee(oTarget);
int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF);
effect eVis = EffectVisualEffect(246);
effect eVis2 = EffectVisualEffect(VFX_IMP_HEALING_G);
effect eHeal, eDam;
//Check that the target is undead
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
{
//Figure out the amount of damage to heal
nHeal = 10 * nCasterLvl;
//Set the heal effect
if(nHeal > 150)
nHeal = 150;
eHeal = EffectHeal(nHeal);
//Apply heal effect and VFX impact
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HARM, FALSE));
}
else if (nTouch) //== TRUE) 1 or 2 are valid return numbers from TouchAttackMelee
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HARM));
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
/* nDamage = GetCurrentHitPoints(oTarget) - d4(1);
//Check for metamagic
if (CheckMetaMagic(nMetaMagic, METAMAGIC_MAXIMIZE))
{
nDamage = GetCurrentHitPoints(oTarget) - 1;
} */
nDamage = 10 * nCasterLvl;
if(nDamage > 150)
nDamage = 150;
// will save for half damage and only drop to 1 hp
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (GetSpellSaveDC()+ GetChangesToSaveDC(oTarget,OBJECT_SELF))))
{
nDamage /= 2;
if( nDamage > GetCurrentHitPoints(oTarget) )
nDamage = GetCurrentHitPoints(oTarget) - 1;
}
eDam = EffectDamage(nDamage,DAMAGE_TYPE_NEGATIVE);
//Apply the VFX impact and effects
DelayCommand(1.0, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

BIN
_removed/nw_s0_heal.ncs Normal file

Binary file not shown.

108
_removed/nw_s0_heal.nss Normal file
View File

@@ -0,0 +1,108 @@
//::///////////////////////////////////////////////
//:: Heal
//:: [NW_S0_Heal.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Heals the target to full unless they are undead.
//:: If undead they reduced to 1d4 HP.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 12, 2001
//:://////////////////////////////////////////////
//:: Update Pass By: Preston W, On: Aug 1, 2001
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
//::Added code to maximize for Faith Healing and Blast Infidel
//::Aaon Graywolf - Jan 7, 2004
#include "spinc_common"
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
effect eKill, eHeal;
int nDamage, nHeal, nModify, nMetaMagic, nTouch;
int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF);
effect eSun = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eHealVis = EffectVisualEffect(VFX_IMP_HEALING_X);
//Check to see if the target is an undead
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HEAL));
//Make a touch attack
if (TouchAttackMelee(oTarget))
{
//Make SR check
if (!MyPRCResistSpell(OBJECT_SELF, oTarget))
{
//Roll damage
nModify = d4();
nMetaMagic = GetMetaMagicFeat();
//Make metamagic check
int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_POSITIVE, TRUE);
if (nMetaMagic == METAMAGIC_MAXIMIZE || iBlastFaith)
{
nModify = 1;
}
//Figure out the amount of damage to inflict
nDamage = GetCurrentHitPoints(oTarget) - nModify;
if(nDamage > 150)
nDamage = 150;
//Set damage
eKill = EffectDamage(nDamage, DAMAGE_TYPE_POSITIVE);
//Apply damage effect and VFX impact
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eKill, oTarget);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eSun, oTarget);
}
}
}
}
else
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HEAL, FALSE));
//Figure out how much to heal
nHeal = GetMaxHitPoints(oTarget);
if(nHeal > 150)
nHeal = 150;
//Set the heal effect
eHeal = EffectHeal(nHeal);
//Apply the heal effect and the VFX impact
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHealVis, oTarget);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
// Code for FB to remove damage that would be caused at end of Frenzy
SetLocalInt(oTarget, "PC_Damage", 0);
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

BIN
_removed/nw_s0_healcirc.ncs Normal file

Binary file not shown.

150
_removed/nw_s0_healcirc.nss Normal file
View File

@@ -0,0 +1,150 @@
//::///////////////////////////////////////////////
//:: Healing Circle
//:: NW_S0_HealCirc
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// Positive energy spreads out in all directions
// from the point of origin, curing 1d8 points of
// damage plus 1 point per caster level (maximum +20)
// to nearby living allies.
//
// Like cure spells, healing circle damages undead in
// its area rather than curing them.
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: Oct 18,2000
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 20, 2001
//:: Update Pass By: Preston W, On: Aug 1, 2001
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
//::Added code to maximize for Faith Healing and Blast Infidel
//::Aaon Graywolf - Jan 7, 2004
#include "spinc_common"
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget;
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
int nCasterLvl = CasterLvl;
int nDamagen, nModify, nHurt, nHP;
int nMetaMagic = GetMetaMagicFeat();
effect eKill;
effect eHeal;
effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eVis2 = EffectVisualEffect(VFX_IMP_HEALING_M);
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_HOLY_20);
float fDelay;
//Limit caster level
if (nCasterLvl > 20)
{
nCasterLvl = 20;
}
CasterLvl +=SPGetPenetr();
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetSpellTargetLocation());
//Get first target in shape
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetSpellTargetLocation());
while (GetIsObjectValid(oTarget))
{
fDelay = GetRandomDelay();
//Check if racial type is undead
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD )
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HEALING_CIRCLE));
//Make SR check
if (!MyPRCResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay))
{
int nDC = GetChangesToSaveDC(oTarget,OBJECT_SELF);
nModify = d8() + nCasterLvl;
//Make metamagic check
int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_POSITIVE, FALSE);
if (nMetaMagic == METAMAGIC_MAXIMIZE || iBlastFaith)
{
nModify = 8 + nCasterLvl;
}
//Make Fort save
if (PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (GetSpellSaveDC()+ nDC), SAVING_THROW_TYPE_NONE, OBJECT_SELF, fDelay))
{
nModify /= 2;
}
//Calculate damage
nHurt = nModify;
//Set damage effect
eKill = EffectDamage(nHurt, DAMAGE_TYPE_POSITIVE);
//Apply damage effect and VFX impact
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eKill, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
else
{
// * May 2003: Heal Neutrals as well
if(!GetIsReactionTypeHostile(oTarget) || GetFactionEqual(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HEALING_CIRCLE, FALSE));
nHP = d8();
//Enter Metamagic conditions
if (CheckMetaMagic(nMetaMagic, METAMAGIC_MAXIMIZE))
{
nHP =8;//Damage is at max
}
if (CheckMetaMagic(nMetaMagic, METAMAGIC_EMPOWER))
{
nHP = nHP + (nHP/2); //Damage/Healing is +50%
}
//Set healing effect
nHP = nHP + nCasterLvl;
eHeal = EffectHeal(nHP);
//Apply heal effect and VFX impact
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
}
}
//Get next target in the shape
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetSpellTargetLocation());
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

BIN
_removed/nw_s0_horrwilt.ncs Normal file

Binary file not shown.

119
_removed/nw_s0_horrwilt.nss Normal file
View File

@@ -0,0 +1,119 @@
//::///////////////////////////////////////////////
//:: Horrid Wilting
//:: NW_S0_HorrWilt
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
All living creatures (not undead or constructs)
suffer 1d8 damage per caster level to a maximum
of 25d8 damage.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Sept 12 , 2001
//:://////////////////////////////////////////////
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
#include "spinc_common"
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oCaster = OBJECT_SELF;
int nCasterLvl = PRCGetCasterLevel(oCaster);
int CasterLvl = nCasterLvl;
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
float fDelay;
effect eExplode = EffectVisualEffect(VFX_FNF_HORRID_WILTING);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eDam;
//Get the spell target location as opposed to the spell target.
location lTarget = GetSpellTargetLocation();
//Limit Caster level for the purposes of damage
if (nCasterLvl > 25)
{
nCasterLvl = 25;
}
CasterLvl +=SPGetPenetr();
//Apply the horrid wilting explosion at the location captured above.
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
//Declare the spell shape, size and the location. Capture the first target object in the shape.
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget);
//Cycle through the targets within the spell shape until an invalid object is captured.
while (GetIsObjectValid(oTarget))
{
// GZ: Not much fun if the caster is always killing himself
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HORRID_WILTING));
//Get the distance between the explosion and the target to calculate delay
fDelay = GetRandomDelay(1.5, 2.5);
if (!MyPRCResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay))
{
if(MyPRCGetRacialType(oTarget) != RACIAL_TYPE_CONSTRUCT && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
int nDC = GetChangesToSaveDC(oTarget,OBJECT_SELF);
//Roll damage for each target
nDamage = d8(nCasterLvl);
//Resolve metamagic
if (CheckMetaMagic(nMetaMagic, METAMAGIC_MAXIMIZE))
{
nDamage = 8 * nCasterLvl;
}
else if (CheckMetaMagic(nMetaMagic, METAMAGIC_EMPOWER))
{
nDamage = nDamage + nDamage / 2;
}
if(/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (GetSpellSaveDC()+ nDC), SAVING_THROW_TYPE_NONE, OBJECT_SELF, fDelay))
{
nDamage = nDamage/2;
}
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL);
// Apply effects to the currently selected target.
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
//This visual effect is applied to the target object not the location as above. This visual effect
//represents the flame that erupts on the target not on the ground.
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Select the next target within the spell shape.
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget);
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

BIN
_removed/nw_s0_masheal.ncs Normal file

Binary file not shown.

128
_removed/nw_s0_masheal.nss Normal file
View File

@@ -0,0 +1,128 @@
//::///////////////////////////////////////////////
//:: Mass Heal
//:: [NW_S0_MasHeal.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Heals all friendly targets within 10ft to full
//:: unless they are undead.
//:: If undead they reduced to 1d4 HP.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 11, 2001
//:://////////////////////////////////////////////
//:: modified by mr_bumpkin Dec 4, and 15, 2003 for PRC stuff
//::Added code to maximize for Faith Healing and Blast Infidel
//::Aaon Graywolf - Jan 7, 2004
#include "spinc_common"
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
effect eKill;
effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eHeal;
effect eVis2 = EffectVisualEffect(VFX_IMP_HEALING_G);
effect eStrike = EffectVisualEffect(VFX_FNF_LOS_HOLY_10);
int nTouch, nModify, nDamage, nHeal;
int nMetaMagic = GetMetaMagicFeat();
float fDelay;
location lLoc = GetSpellTargetLocation();
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
CasterLvl +=SPGetPenetr();
//Apply VFX area impact
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eStrike, lLoc);
//Get first target in spell area
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lLoc);
while(GetIsObjectValid(oTarget))
{
fDelay = GetRandomDelay();
//Check to see if the target is an undead
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD && !GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_MASS_HEAL));
//Make a touch attack
nTouch = TouchAttackRanged(oTarget);
if (nTouch > 0)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Make an SR check
if (!MyPRCResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay))
{
//Roll damage
nModify = d4();
//make metamagic check
int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_POSITIVE, FALSE);
if (nMetaMagic == METAMAGIC_MAXIMIZE || iBlastFaith)
{
nModify = 1;
}
//Detemine the damage to inflict to the undead
nDamage = 10 * CasterLvl;
if(nDamage > 250)
nDamage = 250;
//Set the damage effect
eKill = EffectDamage(nDamage, DAMAGE_TYPE_POSITIVE);
//Apply the VFX impact and damage effect
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eKill, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
}
else
{
//Make a faction check
if(GetIsFriend(oTarget) && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_MASS_HEAL, FALSE));
//Determine amount to heal
nHeal = 10 * CasterLvl;
if(nHeal > 250)
nHeal = 250;
//Set the damage effect
eHeal = EffectHeal(nHeal);
//Apply the VFX impact and heal effect
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
}
}
//Get next target in the spell area
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lLoc);
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

BIN
_removed/nw_s0_negburst.ncs Normal file

Binary file not shown.

150
_removed/nw_s0_negburst.nss Normal file
View File

@@ -0,0 +1,150 @@
//::///////////////////////////////////////////////
//:: Negative Energy Burst
//:: NW_S0_NegBurst
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
The caster releases a burst of negative energy
at a specified point doing 1d8 + 1 / level
negative energy damage
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Sept 13, 2001
//:://////////////////////////////////////////////
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
//::Added code to maximize for Faith Healing and Blast Infidel
//::Aaon Graywolf - Jan 7, 2004
#include "spinc_common"
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oCaster = OBJECT_SELF;
int CasterLvl = PRCGetCasterLevel(oCaster);
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
float fDelay;
effect eExplode = EffectVisualEffect(VFX_FNF_LOS_EVIL_20); //Replace with Negative Pulse
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eVisHeal = EffectVisualEffect(VFX_IMP_HEALING_M);
effect eDam, eHeal;
int nStr = CasterLvl / 4;
if (nStr == 0)
{
nStr = 1;
}
effect eStr = EffectAbilityIncrease(ABILITY_STRENGTH, nStr);
effect eStr_Low = EffectAbilityDecrease(ABILITY_STRENGTH, nStr);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eGood = EffectLinkEffects(eStr, eDur);
effect eBad = EffectLinkEffects(eStr_Low, eDur2);
int nPenetr = CasterLvl + SPGetPenetr();
//Get the spell target location as opposed to the spell target.
location lTarget = GetSpellTargetLocation();
//Apply the explosion at the location captured above.
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
//Declare the spell shape, size and the location. Capture the first target object in the shape.
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget);
//Cycle through the targets within the spell shape until an invalid object is captured.
while (GetIsObjectValid(oTarget))
{
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
int nDC = GetChangesToSaveDC(oTarget,OBJECT_SELF);
//Roll damage for each target
nDamage = d8() + CasterLvl;
//Resolve metamagic
int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_NEGATIVE, FALSE);
if (nMetaMagic == METAMAGIC_MAXIMIZE || iBlastFaith)
{
nDamage = 8 + CasterLvl;
}
if (CheckMetaMagic(nMetaMagic, METAMAGIC_EMPOWER))
{
nDamage = nDamage + (nDamage / 2);
}
if(PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (GetSpellSaveDC()+ nDC), SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay))
{
nDamage /= 2;
}
//Get the distance between the explosion and the target to calculate delay
fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20;
// * any undead should be healed, not just Friendlies
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_NEGATIVE_ENERGY_BURST, FALSE));
//Set the heal effect
eHeal = EffectHeal(nDamage);
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget));
//This visual effect is applied to the target object not the location as above. This visual effect
//represents the flame that erupts on the target not on the ground.
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisHeal, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eGood, oTarget,0.0f,TRUE,-1,CasterLvl));
}
else
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
if(MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
if(!MyPRCResistSpell(OBJECT_SELF, oTarget,nPenetr, fDelay))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_NEGATIVE_ENERGY_BURST));
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
// Apply effects to the currently selected target.
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
//This visual effect is applied to the target object not the location as above. This visual effect
//represents the flame that erupts on the target not on the ground.
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eBad, oTarget,0.0f,TRUE,-1,CasterLvl));
}
}
}
}
//Select the next target within the spell shape.
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget);
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the integer used to hold the spells spell school
}

BIN
_removed/nw_s0_negray.ncs Normal file

Binary file not shown.

113
_removed/nw_s0_negray.nss Normal file
View File

@@ -0,0 +1,113 @@
//::///////////////////////////////////////////////
//:: Negative Energy Ray
//:: NW_S0_NegRay
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Fires a bolt of negative energy at the target
doing 1d6 damage. Does an additional 1d6
damage for 2 levels after level 1 (3,5,7,9) to
a maximum of 5d6 at level 9.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Sept 13, 2001
//:://////////////////////////////////////////////
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
//::Added code to maximize for Faith Healing and Blast Infidel
//::Aaon Graywolf - Jan 7, 2004
#include "spinc_common"
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
int nCasterLevel = CasterLvl;
int nMetaMagic = GetMetaMagicFeat();
if(nCasterLevel > 9)
{
nCasterLevel = 9;
}
nCasterLevel = (nCasterLevel + 1) / 2;
int nDamage = d6(nCasterLevel);
//Enter Metamagic conditions
int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_NEGATIVE, TRUE);
if (nMetaMagic == METAMAGIC_MAXIMIZE || iBlastFaith)
{
nDamage = 6 * nCasterLevel;//Damage is at max
}
if (CheckMetaMagic(nMetaMagic, METAMAGIC_EMPOWER))
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
effect eHeal = EffectHeal(nDamage);
effect eVisHeal = EffectVisualEffect(VFX_IMP_HEALING_M);
effect eRay;
CasterLvl +=SPGetPenetr();
if(MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_NEGATIVE_ENERGY_RAY));
eRay = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND);
if (!MyPRCResistSpell(OBJECT_SELF, oTarget,CasterLvl))
{
//Make a saving throw check
if(/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (GetSpellSaveDC()+ GetChangesToSaveDC(oTarget,OBJECT_SELF)), SAVING_THROW_TYPE_NEGATIVE))
{
nDamage /= 2;
}
//Apply the VFX impact and effects
//DelayCommand(0.5, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(0.5, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
}
}
else
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_NEGATIVE_ENERGY_RAY, FALSE));
eRay = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisHeal, oTarget);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
}
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7,FALSE);
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the integer used to hold the spells spell school
}

BIN
_removed/nw_s0_raisdead.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,56 @@
//::///////////////////////////////////////////////
//:: [Raise Dead]
//:: [NW_S0_RaisDead.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Brings a character back to life with 1 HP.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 31, 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001
//:: VFX Pass By: Preston W, On: June 22, 2001
#include "spinc_common"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
effect eRaise = EffectResurrection();
effect eVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RAISE_DEAD, FALSE));
if(GetIsDead(oTarget))
{
//Apply raise dead effect and VFX impact
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget);
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Gets rid of the local int used to store spell school - for the sake of tidiness.
}

Binary file not shown.

View File

@@ -0,0 +1,126 @@
//::///////////////////////////////////////////////
//:: Remove Effects
//:: NW_SO_RemEffect
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Takes the place of
Remove Disease
Neutralize Poison
Remove Paralysis
Remove Curse
Remove Blindness / Deafness
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 8, 2002
//:://////////////////////////////////////////////
//#include "NW_I0_SPELLS"
#include "X0_I0_SPELLS"
#include "spinc_common"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// This deletes the int used to store spell school, so a new one can be assigned
//Declare major variables
int nSpellID = GetSpellId();
object oTarget = GetSpellTargetObject();
int nEffect1;
int nEffect2;
int nEffect3;
int bAreaOfEffect = FALSE;
effect eVis = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
//Check for which removal spell is being cast.
if(nSpellID == SPELL_REMOVE_BLINDNESS_AND_DEAFNESS)
{
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_DIVINATION);
// Must set which school the spell is before the spell hook, in case spell school
// is a criteria for ending the spell.
nEffect1 = EFFECT_TYPE_BLINDNESS;
nEffect2 = EFFECT_TYPE_DEAF;
bAreaOfEffect = TRUE;
}
else if(nSpellID == SPELL_REMOVE_CURSE)
{
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ABJURATION);
// Must set which school the spell is before the spell hook, in case spell school
// is a criteria for ending the spell.
nEffect1 = EFFECT_TYPE_CURSE;
}
else if(nSpellID == SPELL_REMOVE_DISEASE || nSpellID == SPELLABILITY_REMOVE_DISEASE)
{
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
// Must set which school the spell is before the spell hook, in case spell school
// is a criteria for ending the spell.
nEffect1 = EFFECT_TYPE_DISEASE;
nEffect2 = EFFECT_TYPE_ABILITY_DECREASE;
}
else if(nSpellID == SPELL_NEUTRALIZE_POISON)
{
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
// Must set which school the spell is before the spell hook, in case spell school
// is a criteria for ending the spell.
nEffect1 = EFFECT_TYPE_POISON;
nEffect2 = EFFECT_TYPE_DISEASE;
nEffect3 = EFFECT_TYPE_ABILITY_DECREASE;
}
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
// Moved the spell hook down here, so the spell school int would be set to the caster before it runs.
// * March 2003. Remove blindness and deafness should be an area of effect spell
if (bAreaOfEffect == TRUE)
{
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_HOLY_30);
effect eLink;
spellsGenericAreaOfEffect(OBJECT_SELF, GetSpellTargetLocation(), SHAPE_SPHERE, RADIUS_SIZE_MEDIUM,
SPELL_REMOVE_BLINDNESS_AND_DEAFNESS, eImpact, eLink, eVis,
DURATION_TYPE_INSTANT, 0.0,
SPELL_TARGET_ALLALLIES, FALSE, TRUE, nEffect1, nEffect2);
return;
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID, FALSE));
//Remove effects
RemoveSpecificEffect(nEffect1, oTarget);
if(nEffect2 != 0)
{
RemoveSpecificEffect(nEffect2, oTarget);
}
if(nEffect3 != 0)
{
RemoveSpecificEffect(nEffect3, oTarget);
}
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Gets rid of the local int used to store spell school - for the sake of tidiness.
}

BIN
_removed/nw_s0_resserec.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,85 @@
//::///////////////////////////////////////////////
//:: [Ressurection]
//:: [NW_S0_Ressurec.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Brings a character back to life with full
//:: health.
//:: When cast on placeables, you get a default error message.
//:: * You can specify a different message in
//:: X2_L_RESURRECT_SPELL_MSG_RESREF
//:: * You can turn off the message by setting the variable
//:: to -1
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 31, 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Georg Z on 2003-07-31
//:: VFX Pass By: Preston W, On: June 22, 2001
#include "spinc_common"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Get the spell target
object oTarget = GetSpellTargetObject();
//Check to make sure the target is dead first
//Fire cast spell at event for the specified target
if (GetIsObjectValid(oTarget))
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RESURRECTION, FALSE));
if (GetIsDead(oTarget))
{
//Declare major variables
int nHealed = GetMaxHitPoints(oTarget);
effect eRaise = EffectResurrection();
effect eHeal = EffectHeal(nHealed + 10);
effect eVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD);
//Apply the heal, raise dead and VFX impact effect
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
}
else
{
if (GetObjectType(oTarget) == OBJECT_TYPE_PLACEABLE)
{
int nStrRef = GetLocalInt(oTarget,"X2_L_RESURRECT_SPELL_MSG_RESREF");
if (nStrRef == 0)
{
nStrRef = 83861;
}
if (nStrRef != -1)
{
FloatingTextStrRefOnCreature(nStrRef,OBJECT_SELF);
}
}
}
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Gets rid of the local int used to store spell school - for the sake of tidiness.
}

BIN
_removed/nw_s0_searlght.ncs Normal file

Binary file not shown.

128
_removed/nw_s0_searlght.nss Normal file
View File

@@ -0,0 +1,128 @@
//::///////////////////////////////////////////////
//:: Searing Light
//:: s_SearLght.nss
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Focusing holy power like a ray of the sun, you project
//:: a blast of light from your open palm. You must succeed
//:: at a ranged touch attack to strike your target. A creature
//:: struck by this ray of light suffers 1d8 points of damage
//:: per two caster levels (maximum 5d8). Undead creatures suffer
//:: 1d6 points of damage per caster level (maximum 10d6), and
//:: undead creatures particularly vulnerable to sunlight, such
//:: as vampires, suffer 1d8 points of damage per caster level
//:: (maximum 10d8). Constructs and inanimate objects suffer only
//:: 1d6 points of damage per two caster levels (maximum 5d6).
//:://////////////////////////////////////////////
//:: Created By: Keith Soleski
//:: Created On: 02/05/2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 25, 2001
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
#include "spinc_common"
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oCaster = OBJECT_SELF;
object oTarget = GetSpellTargetObject();
int nMetaMagic = GetMetaMagicFeat();
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
int nCasterLevel = CasterLvl;
int nDamage;
int nMax;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eRay = EffectBeam(VFX_BEAM_HOLY, OBJECT_SELF, BODY_NODE_HAND);
CasterLvl +=SPGetPenetr();
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SEARING_LIGHT));
eRay = EffectBeam(VFX_BEAM_HOLY, OBJECT_SELF, BODY_NODE_HAND);
//Make an SR Check
if (!MyPRCResistSpell(oCaster, oTarget,CasterLvl))
{
//Limit caster level
if (nCasterLevel > 10)
{
nCasterLevel = 10;
}
//Check for racial type undead
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
{
nDamage = d6(nCasterLevel);
nMax = 6;
}
//Check for racial type construct
else if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_CONSTRUCT)
{
nCasterLevel /= 2;
if(nCasterLevel == 0)
{
nCasterLevel = 1;
}
nDamage = d6(nCasterLevel);
nMax = 6;
}
else
{
nCasterLevel = nCasterLevel/2;
if(nCasterLevel == 0)
{
nCasterLevel = 1;
}
nDamage = d8(nCasterLevel);
nMax = 8;
}
//Make metamagic checks
if (CheckMetaMagic(nMetaMagic, METAMAGIC_MAXIMIZE))
{
nDamage = nMax * nCasterLevel;
}
if (CheckMetaMagic(nMetaMagic, METAMAGIC_EMPOWER))
{
nDamage = nDamage + (nDamage/2);
}
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_DIVINE);
//Apply the damage effect and VFX impact
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
DelayCommand(0.5, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
//SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.0);
}
}
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7,FALSE);
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the integer used to hold the spells spell school
}

BIN
_removed/nw_s0_sunbeam.ncs Normal file

Binary file not shown.

144
_removed/nw_s0_sunbeam.nss Normal file
View File

@@ -0,0 +1,144 @@
//::///////////////////////////////////////////////
//:: Sunbeam
//:: s_Sunbeam.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
//:: All creatures in the beam are struck blind and suffer 4d6 points of damage. (A successful
//:: Reflex save negates the blindness and reduces the damage by half.) Creatures to whom sunlight
//:: is harmful or unnatural suffer double damage.
//::
//:: Undead creatures caught within the ray are dealt 1d6 points of damage per caster level
//:: (maximum 20d6), or half damage if a Reflex save is successful. In addition, the ray results in
//:: the total destruction of undead creatures specifically affected by sunlight if they fail their saves.
//:://////////////////////////////////////////////
//:: Created By: Keith Soleski
//:: Created On: Feb 22, 2001
//:://////////////////////////////////////////////
//:: Last Modified By: Keith Soleski, On: March 21, 2001
//:: VFX Pass By: Preston W, On: June 25, 2001
//:: modified by mr_bumpkin Dec 4, 2003
#include "spinc_common"
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
effect eVis2 = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eStrike = EffectVisualEffect(VFX_FNF_SUNBEAM);
effect eDam;
effect eBlind = EffectBlindness();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBlind, eDur);
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
int nDamage;
int nOrgDam;
int nMax;
float fDelay;
int nBlindLength = 3;
int nPenetr = CasterLvl + SPGetPenetr();
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eStrike, GetSpellTargetLocation());
//Get the first target in the spell area
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetSpellTargetLocation());
while(GetIsObjectValid(oTarget))
{
int nCasterLevel= CasterLvl;
//Limit caster level
if (nCasterLevel > 20)
{
nCasterLevel = 20;
}
// Make a faction check
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
fDelay = GetRandomDelay(1.0, 2.0);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SUNBEAM));
//Make an SR check
if ( ! MyPRCResistSpell(OBJECT_SELF, oTarget,nPenetr, 1.0))
{
//Check if the target is an undead
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
{
//Roll damage and save
nDamage = d6(nCasterLevel);
nMax = 6;
}
else
{
//Roll damage and save
nDamage = d6(3);
nOrgDam = nDamage;
nMax = 6;
nCasterLevel = 3;
//Get the adjusted damage due to Reflex Save, Evasion or Improved Evasion
}
//Do metamagic checks
if (CheckMetaMagic(nMetaMagic, METAMAGIC_MAXIMIZE))
{
nDamage = nMax * nCasterLevel;
}
if (CheckMetaMagic(nMetaMagic, METAMAGIC_EMPOWER))
{
nDamage = nDamage + (nDamage/2);
}
int nDC = GetChangesToSaveDC(oTarget,OBJECT_SELF);
//Check that a reflex save was made.
if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, (GetSpellSaveDC() + nDC), SAVING_THROW_TYPE_DIVINE, OBJECT_SELF, 1.0) == 0)
{
DelayCommand(1.0, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nBlindLength),TRUE,-1,CasterLvl));
}
else
{
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, 0, SAVING_THROW_TYPE_DIVINE);
}
//Set damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_DIVINE);
if(nDamage > 0)
{
//Apply the damage effect and VFX impact
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
}
}
}
//Get the next target in the spell area
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetSpellTargetLocation());
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the integer used to hold the spells spell school
}

BIN
_removed/nw_s0_timestop.ncs Normal file

Binary file not shown.

152
_removed/nw_s0_timestop.nss Normal file
View File

@@ -0,0 +1,152 @@
//::///////////////////////////////////////////////
//:: Time Stop
//:: NW_S0_TimeStop.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
All persons in the Area are frozen in time
except the caster.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 7, 2002
//:://////////////////////////////////////////////
//:: modified by mr_bumpkin Dec 4, 2003
//#include "spinc_common"
#include "NW_I0_GENERIC"
#include "x2_inc_spellhook"
#include "NW_I0_SPELLS"
#include "nw_i0_2q4luskan"
// Customize User Defined Variables
//float fDur = 15.0; // Duration in seconds -- Change this to however long you want Time Stop to last Uncomment and Comment out 3rd ed duration
// This is the formula for accurate 3rd ed. duration
int iroll = ((d4(1)) + 1); // Actual rounds
float fDur = IntToFloat(iroll)*6.0;
float fDist = 20.0; // Radius in meters -- for a wider area of affect increase this float
// Function to resume creature(s) previous actions wrapped for Delay
void ResumeLast(object oResumee, object oIntruder)
{
// Delay DetermineCombatRound
//DelayCommand(fDur+0.25,AssignCommand(oResumee,DetermineCombatRound(oIntruder)));
}
// Function to control Time Stop effects
void TSEffects(object oEffector, object oCaster)
{
// Check if stopped creature is a hostile
if ((GetIsReactionTypeHostile(oCaster,oEffector) == TRUE)
&& (GetIsPC(oEffector) == FALSE)
&& (GetIsDMPossessed(oEffector) == FALSE))
{
// Start the resume combat round after Time Stop
ResumeLast(oEffector, oCaster);
}
// Clear the creature(s) action que
AssignCommand(oEffector,ClearAllActions(TRUE));
// Make module dominate the creature(s) for fDur seconds & Freeze the Animation to look like time stopped
//AssignCommand(GetModule(),ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectCutsceneDominated(),oEffector,fDur));
if (GetPlotFlag(oEffector) == TRUE){
SetPlotFlag(oEffector, FALSE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectPetrify(),oEffector,fDur);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION),oEffector,fDur);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_GLOW_LIGHT_BLUE),oEffector,fDur);
SetPlotFlag(oEffector, TRUE);
}
else
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectPetrify(),oEffector,fDur);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION),oEffector,fDur);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_GLOW_LIGHT_BLUE),oEffector,fDur);
SetPlotFlag(oEffector, TRUE);
DelayCommand(fDur, SetPlotFlag(oEffector, FALSE));
}
/* effect eEffect = GetFirstEffect(oEffector);
int nType;
while (GetIsEffectValid(eEffect) == TRUE)
{
nType = GetEffectType(eEffect);
if((nType == EFFECT_TYPE_VISUALEFFECT) && (GetEffectSpellId(eEffect) == SPELL_TIME_STOP))
RemoveEffect(oEffector, eEffect);
eEffect = GetNextEffect(oEffector);
}*/
}
// Function to get creature(s) within radius and apply the alternate Time Stop
void TimeStop(object oTarget)
{
object oNearestC; // Define nearest creature
// Begin loop to find all creatures within the fDist meter radius
oNearestC = GetFirstObjectInArea(GetArea(oTarget));
while(GetIsObjectValid(oNearestC))
{
// To make sure it doesn't stop the caster or caster's familiar, first henchman, or summons
if ((oNearestC != oTarget) &&
(GetObjectType(oNearestC) == OBJECT_TYPE_CREATURE))
// (GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oTarget) != oNearestC) &&
// (GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oTarget) != oNearestC) &&
// (GetAssociate(ASSOCIATE_TYPE_SUMMONED, oTarget) != oNearestC))
{
// Start the Time Stop effects
DelayCommand(0.75,TSEffects(oNearestC,oTarget));
}
// Get the next creature in the fDist meter radius and continue loop
oNearestC = GetNextObjectInArea(GetArea(oTarget));
}
}
// Begin Main Function
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_TRANSMUTATION);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
// return;
}
// End of Spell Cast Hook
//Signal event to start the Time Stop
SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELL_TIME_STOP, FALSE));
// Begin custom Time Stop
TimeStop(OBJECT_SELF);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_TIME_STOP), GetSpellTargetLocation());
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the integer used to hold the spells spell school
}

BIN
_removed/nw_s1_pulsdrwn.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,66 @@
//::///////////////////////////////////////////////
//:: Pulse Drown
//:: NW_S1_PulsDrwn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
CHANGED JANUARY 2003
- does an actual 'drown spell' on each target
in the area of effect.
- Each use of this spells consumes 50% of the
elementals hit points.
No spell hook so manually altered to not affect pc vampires as well. -Fallen
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watmaniuk
//:: Created On: April 15, 2002
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "f_vampire_spls_h"
void Drown(object oTarget)
{
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
// * certain racial types are immune
if ((GetRacialType(oTarget) != RACIAL_TYPE_CONSTRUCT)
&&(GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
&&(GetRacialType(oTarget) != RACIAL_TYPE_ELEMENTAL) && !GetIsVampire(oTarget))
{
//Make a fortitude save
if(MySavingThrow(SAVING_THROW_FORT, oTarget, 20) == FALSE)
{
//Apply the VFX impact and damage effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
//Set damage effect to kill the target
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oTarget);
}
}
}
void main ()
{
int nDamage = GetCurrentHitPoints() / 2;
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDamage(nDamage), OBJECT_SELF);
//Declare major variables
object oTarget;
int bSave = FALSE;
int nIdx;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_WATER);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
while(GetIsObjectValid(oTarget) == TRUE)
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_DROWN));
Drown(oTarget);
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
}
}

BIN
_removed/nw_s1_pulsholy.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,79 @@
//::///////////////////////////////////////////////
//:: Pulse: Holy
//:: NW_S1_PulsHoly
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants. Undead are damaged, allies are healed.
No spell hooks so manually altered for compatability with pc vampires. -Fallen
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "f_vampire_spls_h"
void main()
{
//Declare major variables
int nDamage;
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_M);
effect eVis2 = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eHowl;
int nHD = GetHitDice(OBJECT_SELF);
int nDC = 10 + nHD;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_HOLY);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
//Get first target in spell area
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
while(GetIsObjectValid(oTarget))
{
//Determine effect delay
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
//Roll the amount to heal or damage
nDamage = d4(nHD);
//If the target is not undead
if (GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD && (!GetIsVampire(oTarget) || GetHasEpicAbility(FALLEN_VAMPIRE_EPIC_HOLY_VAMPIRE, oTarget)))
{
//Make a faction check
if(oTarget != OBJECT_SELF)
{
if(GetIsFriend(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_HOLY, FALSE));
//Set heal effect
eHowl = EffectHeal(nDamage);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
else
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_DIVINE);
//Set damage effect
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_DIVINE) ;
if(nDamage > 0)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_HOLY));
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
}
}

BIN
_removed/nw_s1_pulsneg.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,77 @@
//::///////////////////////////////////////////////
//:: Pulse: Negative
//:: NW_S1_PulsDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants. Undead are healed.
No spell hooks so manually altered for compatability with pc vampires. -Fallen
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "f_vampire_spls_h"
void main()
{
//Declare major variables
int nDamage;
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_M);
effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
int nHD = GetHitDice(OBJECT_SELF);
int nDC = 10 + nHD;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
//Get first target in spell area
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
while(GetIsObjectValid(oTarget))
{
if(oTarget != OBJECT_SELF)
{
//Determine effect delay
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
//Roll the amount to heal or damage
nDamage = d4(nHD);
//If the target is undead
if (GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || GetIsVampire(oTarget))
{
//Make a faction check
if(GetIsFriend(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_HOLY, FALSE));
//Set heal effect
eHowl = EffectHeal(nDamage);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
else
{
if(!GetIsReactionTypeFriendly(oTarget) && GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD && !GetIsVampire(oTarget))
{
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE);
//Set damage effect
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
if(nDamage > 0)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_HOLY));
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
}
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
}
}

Binary file not shown.

View File

@@ -0,0 +1,149 @@
//::///////////////////////////////////////////////
//:: Lay_On_Hands
//:: NW_S2_LayOnHand.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
The Paladin is able to heal his Chr Bonus times
his level.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Aug 15, 2001
//:: Updated On: Oct 20, 2003
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
void main()
{
object oTarget = GetSpellTargetObject();
int nChr = GetAbilityModifier(ABILITY_CHARISMA);
// Added by Starlight 2004-5-14
// Check whether the character has "Hand of A Healer Feat" and
// with 13+ Charisma
// If yes, +2 to Charisma Score during casting Lay On Hands
// i.e. +1 bonus to Charisma Modifier
if (GetAlignmentGoodEvil(OBJECT_SELF) == ALIGNMENT_GOOD){
if (GetHasFeat(FEAT_HAND_HEALER)){
nChr = nChr + 1;
}
}
// End of Hand of Healer Code
if (nChr < 0)
{
nChr = 0;
}
int nLevel = GetLevelByClass(CLASS_TYPE_PALADIN);
//--------------------------------------------------------------------------
// July 2003: Add Divine Champion levels to lay on hands ability
//--------------------------------------------------------------------------
nLevel = nLevel + GetLevelByClass(CLASS_TYPE_DIVINECHAMPION);
//--------------------------------------------------------------------------
// March 2004: Add Hospitaler levels to lay on hands ability
//--------------------------------------------------------------------------
nLevel = nLevel + GetLevelByClass(CLASS_TYPE_HOSPITALER);
//--------------------------------------------------------------------------
// Caluclate the amount to heal, min is 1 hp
//--------------------------------------------------------------------------
int nHeal = nLevel * nChr;
if(nHeal <= 0)
{
nHeal = 1;
}
effect eHeal = EffectHeal(nHeal);
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_M);
effect eVis2 = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eEVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
effect eEVis2 = EffectVisualEffect(VFX_IMP_DESTRUCTION);
effect eDam;
int nTouch;
// evil paladins should not heal non-undead, they should do damage, and heal undead. ~ Lock
if (GetAlignmentGoodEvil(OBJECT_SELF) == ALIGNMENT_EVIL)
{
if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || GetLevelByClass(CLASS_TYPE_UNDEAD,oTarget)>0)
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_LAY_ON_HANDS, FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEVis2, oTarget);
}
else
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_LAY_ON_HANDS));
//Make a ranged touch attack
nTouch = TouchAttackMelee(oTarget,TRUE);
//----------------------------------------------------------------------
// GZ: The PhB classifies Lay on Hands as spell like ability, so it is
// subject to SR. No more cheesy demi lich kills on touch, sorry.
//----------------------------------------------------------------------
int nResist = MyResistSpell(OBJECT_SELF,oTarget);
if (nResist == 0 )
{
if(nTouch > 0)
{
if(nTouch == 2)
{
nHeal *= 2;
}
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_LAY_ON_HANDS));
eDam = EffectDamage(nHeal, DAMAGE_TYPE_DIVINE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEVis, oTarget);
}
}
}
}
//--------------------------------------------------------------------------
// A good-aligned paladin can use his lay on hands ability to damage undead creatures
// having undead class levels qualifies as undead as well
//--------------------------------------------------------------------------
if (GetAlignmentGoodEvil(OBJECT_SELF) == ALIGNMENT_GOOD || GetAlignmentGoodEvil(OBJECT_SELF) == ALIGNMENT_NEUTRAL)
{
if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || GetLevelByClass(CLASS_TYPE_UNDEAD,oTarget)>0)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_LAY_ON_HANDS));
//Make a ranged touch attack
nTouch = TouchAttackMelee(oTarget,TRUE);
//----------------------------------------------------------------------
// GZ: The PhB classifies Lay on Hands as spell like ability, so it is
// subject to SR. No more cheesy demi lich kills on touch, sorry.
//----------------------------------------------------------------------
int nResist = MyResistSpell(OBJECT_SELF,oTarget);
if (nResist == 0 )
{
if(nTouch > 0)
{
if(nTouch == 2)
{
nHeal *= 2;
}
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_LAY_ON_HANDS));
eDam = EffectDamage(nHeal, DAMAGE_TYPE_DIVINE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
}
}
}
else
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_LAY_ON_HANDS, FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

BIN
_removed/nw_s2_turndead.ncs Normal file

Binary file not shown.

420
_removed/nw_s2_turndead.nss Normal file
View File

@@ -0,0 +1,420 @@
//::///////////////////////////////////////////////
//:: Turn Undead
//:: NW_S2_TurnDead
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Checks domain powers and class to determine
the proper turning abilities of the casting
character.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 2, 2001
//:: Updated On: Jul 15, 2003 - Georg Zoeller
//:://////////////////////////////////////////////
//:: MODIFIED MARCH 5 2003 for Blackguards
//:: MODIFIED JULY 24 2003 for Planar Turning to include turn resistance hd
//:: Modified November 29, 2003 for Evil Cleric Rebuke/Command by Wes Baran
//:: Modified December 29, 2003 for 1.61 patch
// Checks to see if an evil cleric has control 'slots' to command
// the specified undead
// if TRUE, the cleric has enough levels of control to control the undead
// if FALSE, the cleric will rebuke the undead instead
#include "prc_alterations"
// Checks to see if an evil cleric has control 'slots' to command
// the specified undead
// if TRUE, the cleric has enough levels of control to control the undead
// if FALSE, the cleric will rebuke the undead instead
int CanCommand(int nClassLevel, int nTargetHD) {
int nSlots = GetLocalInt(OBJECT_SELF, "wb_clr_comm_slots");
int nNew = nSlots + nTargetHD;
//FloatingTextStringOnCreature("The variable is " + IntToString(nSlots), OBJECT_SELF);
if(nClassLevel >= nNew) {
return TRUE;
}
return FALSE;
}
void AddCommand(int nTargetHD) {
int nSlots = GetLocalInt(OBJECT_SELF, "wb_clr_comm_slots");
SetLocalInt(OBJECT_SELF, "wb_clr_comm_slots", nSlots + nTargetHD);
}
void SubCommand(int nTargetHD) {
int nSlots = GetLocalInt(OBJECT_SELF, "wb_clr_comm_slots");
SetLocalInt(OBJECT_SELF, "wb_clr_comm_slots", nSlots - nTargetHD);
}
void RebukeUndead(int nTurnLevel, int nTurnHD, int nVermin, int nElemental, int nConstructs, int nOutsider, int nClassLevel, int nPlanar) {
//Gets all creatures in a 20m radius around the caster and rebukes them or not. If the creatures
//HD are 1/2 or less of the nClassLevel then the creature is commanded (dominated).
int nCnt = 1;
int nHD, nRacial, nHDCount, bValid, nDamage;
nHDCount = 0;
effect eVis = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
effect eVisTurn = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED);
effect eDamage;
effect eTurned = EffectCutsceneParalyze();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eVisTurn, eTurned);
eLink = EffectLinkEffects(eLink, eDur);
effect eDeath = SupernaturalEffect(EffectCutsceneDominated());
effect eDomin = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
effect eDeathLink = EffectLinkEffects(eDeath, eDomin);
effect eImpactVis = EffectVisualEffect(VFX_FNF_LOS_EVIL_30);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpactVis, GetLocation(OBJECT_SELF));
int iMastery = GetHasFeat(FEAT_UNDEAD_MASTERY);
if (iMastery) nTurnHD*= 10;
//Get nearest enemy within 20m (60ft)
//Why are you using GetNearest instead of MyFirstObjectInShape
// Because ability description says "gets closest first" :P
object oTarget = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC , OBJECT_SELF, nCnt);
while(GetIsObjectValid(oTarget) && nHDCount < nTurnHD && GetDistanceToObject(oTarget) <= 20.0)
{
if(!GetIsFriend(oTarget))
{
nHD = GetHitDice(oTarget) + GetTurnResistanceHD(oTarget);
nRacial = MyPRCGetRacialType(oTarget);
if (nRacial == RACIAL_TYPE_OUTSIDER )
{
if (nPlanar)
{
//Planar turning decreases spell resistance against turning by 1/2
nHD = GetHitDice(oTarget) + (GetSpellResistance(oTarget) /2) + GetTurnResistanceHD(oTarget);
}
else
{
nHD = GetHitDice(oTarget) + (GetSpellResistance(oTarget) + GetTurnResistanceHD(oTarget) );
}
}
else //(full turn resistance)
{
nHD = GetHitDice(oTarget) + GetTurnResistanceHD(oTarget);
}
if (iMastery && nRacial != RACIAL_TYPE_UNDEAD) nHD*= 10;
if(nHD <= nTurnLevel && nHD <= (nTurnHD - nHDCount))
{
//Check the various domain turning types
if(nRacial == RACIAL_TYPE_UNDEAD)
{
bValid = TRUE;
}
else if (nRacial == RACIAL_TYPE_VERMIN && nVermin > 0)
{
bValid = TRUE;
}
else if (nRacial == RACIAL_TYPE_ELEMENTAL && nElemental > 0)
{
bValid = TRUE;
}
else if (nRacial == RACIAL_TYPE_CONSTRUCT && nConstructs > 0)
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_TURN_UNDEAD));
nDamage = d3(nTurnLevel);
eDamage = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
DelayCommand(0.01, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget));
nHDCount += nHD;
}
else if (nRacial == RACIAL_TYPE_OUTSIDER && nOutsider > 0)
{
bValid = TRUE;
}
//Apply results of the turn
if( bValid == TRUE)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
//if(IntToFloat(nClassLevel)/2.0 >= IntToFloat(nHD))
//{
if((nClassLevel/2) >= nHD && CanCommand(nClassLevel, nHD))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_TURN_UNDEAD));
//Destroy the target
DelayCommand(0.1f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDeathLink, oTarget, RoundsToSeconds(nClassLevel + 5)));
//AssignCommand(oTarget, ClearAllActions());
//SetIsTemporaryFriend(oTarget, OBJECT_SELF, TRUE, RoundsToSeconds(nClassLevel + 5));
AddCommand(nHD);
DelayCommand(RoundsToSeconds(nClassLevel + 5), SubCommand(nHD));
}
else
{
//Turn the target
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_TURN_UNDEAD));
//AssignCommand(oTarget, ActionMoveAwayFromObject(OBJECT_SELF, TRUE));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nClassLevel + 5));
}
nHDCount = nHDCount + nHD;
}
}
bValid = FALSE;
}
nCnt++;
oTarget = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF, nCnt);
}
}
void TurnUndead(int nTurnLevel, int nTurnHD, int nVermin, int nElemental, int nConstructs, int nOutsider, int nClassLevel, int nPlanar) {
//Gets all creatures in a 20m radius around the caster and turns them or not. If the creatures
//HD are 1/2 or less of the nClassLevel then the creature is destroyed.
int nCnt = 1;
int nHD, nRacial, nHDCount, bValid, nDamage;
nHDCount = 0;
effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eVisTurn = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eDamage;
effect eTurned = EffectTurned();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eVisTurn, eTurned);
eLink = EffectLinkEffects(eLink, eDur);
effect eDeath = SupernaturalEffect(EffectDeath(TRUE));
effect eImpactVis = EffectVisualEffect(VFX_FNF_LOS_HOLY_30);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpactVis, GetLocation(OBJECT_SELF));
//Get nearest enemy within 20m (60ft)
//Why are you using GetNearest instead of MyFirstObjectInShape
// Because ability description says "gets closest first" :P
object oTarget = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC , OBJECT_SELF, nCnt);
while(GetIsObjectValid(oTarget) && nHDCount < nTurnHD && GetDistanceToObject(oTarget) <= 20.0)
{
if(!GetIsFriend(oTarget))
{
nHD = GetHitDice(oTarget) + GetTurnResistanceHD(oTarget);
nRacial = MyPRCGetRacialType(oTarget);
if (nRacial == RACIAL_TYPE_OUTSIDER )
{
if (nPlanar)
{
//Planar turning decreases spell resistance against turning by 1/2
nHD = GetHitDice(oTarget) + (GetSpellResistance(oTarget) /2) + GetTurnResistanceHD(oTarget);
}
else
{
nHD = GetHitDice(oTarget) + (GetSpellResistance(oTarget) + GetTurnResistanceHD(oTarget) );
}
}
else //(full turn resistance)
{
nHD = GetHitDice(oTarget) + GetTurnResistanceHD(oTarget);
}
if(nHD <= nTurnLevel && nHD <= (nTurnHD - nHDCount))
{
//Check the various domain turning types
if(nRacial == RACIAL_TYPE_UNDEAD)
{
bValid = TRUE;
}
else if (nRacial == RACIAL_TYPE_VERMIN && nVermin > 0)
{
bValid = TRUE;
}
else if (nRacial == RACIAL_TYPE_ELEMENTAL && nElemental > 0)
{
bValid = TRUE;
}
else if (nRacial == RACIAL_TYPE_CONSTRUCT && nConstructs > 0)
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_TURN_UNDEAD));
nDamage = d3(nTurnLevel);
eDamage = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
DelayCommand(0.01, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget));
nHDCount += nHD;
}
else if (nRacial == RACIAL_TYPE_OUTSIDER && nOutsider > 0)
{
bValid = TRUE;
}
//Apply results of the turn
if( bValid == TRUE)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
//if(IntToFloat(nClassLevel)/2.0 >= IntToFloat(nHD))
//{
if((nClassLevel/2) >= nHD)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_TURN_UNDEAD));
//Destroy the target
DelayCommand(0.1f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget));
}
else
{
//Turn the target
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_TURN_UNDEAD));
AssignCommand(oTarget, ActionMoveAwayFromObject(OBJECT_SELF, TRUE));
// Added by SoulTaker and Modified by Starlight
// 2004-5-16
// Check whether Exalted Turning exist
// if yes, all turned undead take 3d6 damage also
if (GetHasFeat(FEAT_EXALTED_TURNING) && nRacial == RACIAL_TYPE_UNDEAD)
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(d6(3), DAMAGE_TYPE_DIVINE), oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nClassLevel + 5));
}
nHDCount = nHDCount + nHD;
}
}
bValid = FALSE;
}
nCnt++;
oTarget = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF, nCnt);
}
}
void main()
{
int nClericLevel = GetLevelByClass(CLASS_TYPE_CLERIC);
int nPaladinLevel = GetLevelByClass(CLASS_TYPE_PALADIN);
int nBlackguardlevel = GetLevelByClass(CLASS_TYPE_BLACKGUARD);
int nHospLevel = GetLevelByClass(CLASS_TYPE_HOSPITALER);
int nSolLevel = GetLevelByClass(CLASS_TYPE_SOLDIER_OF_LIGHT);
int nTNLevel = GetLevelByClass(CLASS_TYPE_TRUENECRO);
int nTotalLevel = GetHitDice(OBJECT_SELF);
int nTurnLevel = nClericLevel;
int nClassLevel = nClericLevel;
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
// GZ: Since paladin levels stack when turning, blackguard levels should stack as well
// GZ: but not with the paladin levels (thus else if).
if(nTNLevel > 0)
{
nClassLevel += (nTNLevel);
nTurnLevel += (nTNLevel);
}
if((nBlackguardlevel - 2) > 0 && (nBlackguardlevel > nPaladinLevel))
{
nClassLevel += (nBlackguardlevel - 2);
nTurnLevel += (nBlackguardlevel - 2);
}
else if((nPaladinLevel - 2) > 0)
{
nClassLevel += (nPaladinLevel -2);
nTurnLevel += (nPaladinLevel - 2);
}
if((nHospLevel - 2) > 0)
{
nClassLevel += (nHospLevel -2);
nTurnLevel += (nHospLevel - 2);
}
if ( nAlign == ALIGNMENT_GOOD)
{
nClassLevel += nSolLevel;
nTurnLevel += nSolLevel;
}
//Flags for bonus turning types
int nElemental = GetHasFeat(FEAT_AIR_DOMAIN_POWER) + GetHasFeat(FEAT_EARTH_DOMAIN_POWER) + GetHasFeat(FEAT_FIRE_DOMAIN_POWER) + GetHasFeat(FEAT_WATER_DOMAIN_POWER);
int nVermin = GetHasFeat(FEAT_PLANT_DOMAIN_POWER) + GetHasFeat(FEAT_ANIMAL_COMPANION);
int nConstructs = GetHasFeat(FEAT_DESTRUCTION_DOMAIN_POWER);
int nOutsider = GetHasFeat(FEAT_GOOD_DOMAIN_POWER) + GetHasFeat(FEAT_EVIL_DOMAIN_POWER);
int nPlanar = GetHasFeat(854);
//Flag for improved turning ability
int nSun = GetHasFeat(FEAT_SUN_DOMAIN_POWER);
int nMaster = GetHasFeat(FEAT_MASTER_OF_ENERGY);
//Make a turning check roll, modify if have the Sun Domain
int nChrMod = GetAbilityModifier(ABILITY_CHARISMA);
int nTurnCheck = d20() + nChrMod; //The roll to apply to the max HD of undead that can be turned --> nTurnLevel
int nTurnHD = d6(2) + nChrMod + nClassLevel; //The number of HD of undead that can be turned.
if (GetHasFeat(FEAT_HEART_PASSION))
{
nTurnCheck +=2;
nTurnHD +=2;
}
if(nMaster == TRUE)
{
nTurnCheck += 4;
nTurnHD += 4;
}
if(nSun == TRUE)
{
nTurnCheck += d4();
nTurnHD += d6();
}
if (nAlign != ALIGNMENT_EVIL && (GetHasSpellEffect(SPELL_ANTIPAL_DESECRATE) || GetHasSpellEffect(SPELL_DES_20)||GetHasSpellEffect(SPELL_DES_100)))
{
nTurnCheck -= 3;
}
//Determine the maximum HD of the undead that can be turned.
if(nTurnCheck <= 0)
{
nTurnLevel -= 4;
}
else if(nTurnCheck >= 1 && nTurnCheck <= 3)
{
nTurnLevel -= 3;
}
else if(nTurnCheck >= 4 && nTurnCheck <= 6)
{
nTurnLevel -= 2;
}
else if(nTurnCheck >= 7 && nTurnCheck <= 9)
{
nTurnLevel -= 1;
}
else if(nTurnCheck >= 10 && nTurnCheck <= 12)
{
//Stays the same
}
else if(nTurnCheck >= 13 && nTurnCheck <= 15)
{
nTurnLevel += 1;
}
else if(nTurnCheck >= 16 && nTurnCheck <= 18)
{
nTurnLevel += 2;
}
else if(nTurnCheck >= 19 && nTurnCheck <= 21)
{
nTurnLevel += 3;
}
else if(nTurnCheck >= 22)
{
nTurnLevel += 4;
}
int nEmpower = GetHasFeat(FEAT_EMPOWER_TURNING);
int nMaximize = GetHasFeat(FEAT_MAXIMIZE_TURNING) && nAlign == ALIGNMENT_GOOD ;
if (nMaximize)
nTurnHD *= 2;
else
nTurnHD = nEmpower ? nTurnHD+nTurnHD/2 : nTurnHD;
if(nAlign == ALIGNMENT_EVIL) {
RebukeUndead(nTurnLevel, nTurnHD, nVermin, nElemental, nConstructs, nOutsider, nClassLevel, nPlanar);
}
else {
TurnUndead(nTurnLevel, nTurnHD, nVermin, nElemental, nConstructs, nOutsider, nClassLevel, nPlanar);
}
}

Binary file not shown.

View File

@@ -0,0 +1,64 @@
//::///////////////////////////////////////////////
//:: Balor On Death
//:: NW_S3_BALORDETH
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Fireball explosion does 50 damage to all within
20ft
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 9, 2002
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
void main()
{
//Declare major variables
object oCaster = OBJECT_SELF;
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
float fDelay;
effect eExplode = EffectVisualEffect(VFX_FNF_FIREBALL);
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
effect eDam;
//Get the spell target location as opposed to the spell target.
location lTarget = GetLocation(OBJECT_SELF);
//Limit Caster level for the purposes of damage
//Apply the fireball explosion at the location captured above.
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
//Declare the spell shape, size and the location. Capture the first target object in the shape.
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR);
//Cycle through the targets within the spell shape until an invalid object is captured.
while (GetIsObjectValid(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FIREBALL));
//Get the distance between the explosion and the target to calculate delay
fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20;
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
{
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = GetReflexAdjustedDamage(50, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_FIRE);
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
// Apply effects to the currently selected target.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
//This visual effect is applied to the target object not the location as above. This visual effect
//represents the flame that erupts on the target not on the ground.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Select the next target within the spell shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR);
}
ExecuteScript("xp_opw_system", OBJECT_SELF);
ExecuteScript("prc_default7", OBJECT_SELF);
// Destroy ourselves - we just exploded!
SetIsDestroyable(TRUE, FALSE, FALSE);
SetPlotFlag(OBJECT_SELF, FALSE);
DestroyObject(OBJECT_SELF);
}

57
_removed/nw_s3_herb.nss Normal file
View File

@@ -0,0 +1,57 @@
//::///////////////////////////////////////////////
//:: NW_S3_HERB.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Various herbs to offer bonuses to the player using
them.
Belladonna:
Garlic:
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
#include "f_vampire_h"
void main()
{
int nID = GetSpellId();
// * Belladonna
if (nID == 409)
{
object oTarget = GetSpellTargetObject();
effect eVisual = EffectVisualEffect(VFX_IMP_AC_BONUS);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVisual, oTarget);
effect eACBonus = VersusRacialTypeEffect(EffectACIncrease(5), RACIAL_TYPE_SHAPECHANGER);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eACBonus, oTarget, 60.0);
}
else
// * Garlic; protection against Vampires
// * Lowers charisma
// Altered: as a vampire garlic will make you lose all your bonuses for a minute! (ow)
if (nID == 410)
{
object oTarget = GetSpellTargetObject();
effect eAttackBonus = VersusRacialTypeEffect(EffectAttackIncrease(2), RACIAL_TYPE_UNDEAD);
effect eCharisma = EffectAbilityDecrease(ABILITY_CHARISMA, 1);
effect eVisual = EffectVisualEffect(VFX_IMP_AC_BONUS);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVisual, oTarget);
if(GetIsVampire(oTarget))
{
eVisual = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVisual, oTarget, 60.0);
Vampire_Remove_Stats(oTarget);
Vampire_Equipment_Removal(oTarget);
FloatingTextStringOnCreature("The garlic hides your vampiric abilities for a time.", oTarget);
DelayCommand(60.0, Vampire_Apply_Stats(oTarget));
DelayCommand(60.0, Vampire_Equipment_Creation(oTarget));
}
else
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAttackBonus, oTarget, 60.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCharisma, oTarget, 60.0);
}
}
}

BIN
_removed/nw_t1_holyavgc.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,43 @@
//::///////////////////////////////////////////////
//:: Average Holy Trap
//:: NW_T1_HolyAvgC
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Strikes the entering undead with a beam of pure
sunlight for 5d10 damage.
Altered to support PC Vampires - Fallen
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: July 4th, 2001
//:://////////////////////////////////////////////
#include "f_vampire_spls_h"
void main()
{
//Declare major variables
object oTarget = GetEnteringObject();
int nAC = GetAC(oTarget);
//Make attack roll
int nRoll = d20() + 10 + 3;
effect eDam = EffectDamage(d10(5), DAMAGE_TYPE_DIVINE);
effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
if (nRoll > 0)
{
if (GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || GetIsVampire(oTarget))
{
//Apply Holy Damage and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
else
{
eDam = EffectDamage(d4(3), DAMAGE_TYPE_DIVINE);
//Apply Holy Damage and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,43 @@
//::///////////////////////////////////////////////
//:: Deadly Holy Trap
//:: NW_T1_HolyDeadC
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Strikes the entering undead with a dose of holy
water for 12d10 damage.
Altered to support PC Vampires - Fallen
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: July 4th, 2001
//:://////////////////////////////////////////////
#include "f_vampire_spls_h"
void main()
{
//Declare major variables
object oTarget = GetEnteringObject();
int nAC = GetAC(oTarget);
//Make attack roll
int nRoll = d20() + 10 + 8;
effect eDam = EffectDamage(d10(12), DAMAGE_TYPE_DIVINE);
effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
if (nRoll > 0)
{
if (GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || GetIsVampire(oTarget))
{
//Apply Holy Damage and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
else
{
eDam = EffectDamage(d4(8), DAMAGE_TYPE_DIVINE);
//Apply Holy Damage and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,43 @@
//::///////////////////////////////////////////////
//:: Minor Holy Trap
//:: NW_T1_HolyMinoC
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Strikes the entering undead with a beam of pure
sunlight for 2d10 damage.
Altered to support PC Vampires - Fallen
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: July 4th, 2001
//:://////////////////////////////////////////////
#include "f_vampire_spls_h"
void main()
{
//Declare major variables
object oTarget = GetEnteringObject();
int nAC = GetAC(oTarget);
//Make attack roll
int nRoll = d20(1) + 10 + 2;
effect eDam = EffectDamage(d10(4), DAMAGE_TYPE_DIVINE);
effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
if (nRoll > 0)
{
if (GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || GetIsVampire(oTarget))
{
//Apply Holy Damage and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
else
{
eDam = EffectDamage(d4(2), DAMAGE_TYPE_DIVINE);
//Apply Holy Damage and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

BIN
_removed/nw_t1_holystrc.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,43 @@
//::///////////////////////////////////////////////
//:: Strong Holy Trap
//:: NW_T1_HolyStrC
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Strikes the entering undead with a dose of holy
water for 8d10 damage.
Altered to support PC Vampires - Fallen
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: July 4th, 2001
//:://////////////////////////////////////////////
#include "f_vampire_spls_h"
void main()
{
//Declare major variables
object oTarget = GetEnteringObject();
int nAC = GetAC(oTarget);
//Make attack roll
int nRoll = d20() + 10 + 6;
effect eDam = EffectDamage(d10(8), DAMAGE_TYPE_DIVINE);
effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
if (nRoll > 0)
{
if (GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || GetIsVampire(oTarget))
{
//Apply Holy Damage
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
else
{
eDam = EffectDamage(d4(6), DAMAGE_TYPE_DIVINE);
//Apply Holy Damage
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@@ -0,0 +1,121 @@
const int CLASS_TYPE_ABJURER = 217;
const int CLASS_TYPE_ACOLYTE = 68;
const int CLASS_TYPE_ANTI_PALADIN = 113;
const int CLASS_TYPE_ARCANE_ASSASSIN = 230;
const int CLASS_TYPE_ARCANE_DUELIST = 95;
const int CLASS_TYPE_ARCANE_SWORDSMAN = 231;
const int CLASS_TYPE_ARCANE_THEOLOGIST = 22;
const int CLASS_TYPE_ARCHER = 125;
const int CLASS_TYPE_ARCHMAGE = 100;
const int CLASS_TYPE_ARCTRICK = 152;
const int CLASS_TYPE_ASTRAL_ADEPT = 213;
const int CLASS_TYPE_AURAMANCER = 215;
const int CLASS_TYPE_BATTLEMAGE = 226;
const int CLASS_TYPE_BATTLERAGER = 52;
const int CLASS_TYPE_BFZ = 165;
const int CLASS_TYPE_BLADESINGER = 124;
const int CLASS_TYPE_BLARCHER = 156;
const int CLASS_TYPE_BONDED_SUMMONNER = 121;
const int CLASS_TYPE_BRAWLER = 254;
const int CLASS_TYPE_BRUTAL_SAVAGE = 205;
const int CLASS_TYPE_CHAMPION_BANE = 69;
const int CLASS_TYPE_CORRUPTER = 112;
const int CLASS_TYPE_CRYSTAL_MASTER = 229;
const int CLASS_TYPE_CW_SAMURAI = 132;
const int CLASS_TYPE_DEMON_MASTER = 214;
const int CLASS_TYPE_DISC_BAALZEBUL = 128;
const int CLASS_TYPE_DISCIPLE_OF_DARKNESS = 216;
const int CLASS_TYPE_DISCIPLE_OF_MEPH = 200;
const int CLASS_TYPE_DISPATER = 131;
const int CLASS_TYPE_DIVESA = 78;
const int CLASS_TYPE_DIVESC = 76;
const int CLASS_TYPE_DIVESE = 77;
const int CLASS_TYPE_DIVESF = 75;
const int CLASS_TYPE_DRAGON_SLAYER = 208;
const int CLASS_TYPE_DRAGONSONG_LYRIST = 114;
const int CLASS_TYPE_DRUNKEN_MASTER = 203;
const int CLASS_TYPE_DUELIST = 80;
const int CLASS_TYPE_ELDRITCH_KNIGHT = 70;
const int CLASS_TYPE_ES_ACID = 74;
const int CLASS_TYPE_ES_COLD = 72;
const int CLASS_TYPE_ES_ELEC = 73;
const int CLASS_TYPE_ES_FIRE = 71;
const int CLASS_TYPE_EYE_OF_GRUUMSH = 180;
const int CLASS_TYPE_FAVORED_MILIL = 252;
const int CLASS_TYPE_FISTRAZIEL = 88;
const int CLASS_TYPE_FOE_HUNTER = 179;
const int CLASS_TYPE_FRE_BERSERKER = 177;
const int CLASS_TYPE_GEOMANCER = 221;
const int CLASS_TYPE_GREY_WANDERER = 210;
const int CLASS_TYPE_HARPERMAGE = 66;
const int CLASS_TYPE_HATHRAN = 84;
const int CLASS_TYPE_HEALER = 222;
const int CLASS_TYPE_HEARTWARDER = 87;
const int CLASS_TYPE_HENSHIN_MYSTIC = 202;
const int CLASS_TYPE_HEXTOR = 155;
const int CLASS_TYPE_HIEROPHANT = 81;
const int CLASS_TYPE_HOLY_CRUSADER = 209;
const int CLASS_TYPE_HOSPITALER = 174;
const int CLASS_TYPE_IAIJUTSU_MASTER = 130;
const int CLASS_TYPE_INITIATE_DRACONIC = 122;
const int CLASS_TYPE_JUDICATOR = 105;
const int CLASS_TYPE_KNIGHT_CHALICE = 83;
const int CLASS_TYPE_KNIGHT_MIDDLECIRCLE = 167;
const int CLASS_TYPE_LEGENDARY_DREADNOUGHT = 127;
const int CLASS_TYPE_LICH = 90;
const int CLASS_TYPE_MAGEKILLER = 65;
const int CLASS_TYPE_MANATARMS = 119;
const int CLASS_TYPE_MASTER_HARPER = 176;
const int CLASS_TYPE_MASTER_HARPER_DIV = 172;
const int CLASS_TYPE_MASTER_OF_SHROUDS = 175;
const int CLASS_TYPE_MASTERH = 111;
const int CLASS_TYPE_MINSTREL_EDGE = 253;
const int CLASS_TYPE_MYSTIC_THEURGE = 53;
const int CLASS_TYPE_MYSTICAL_KNIGHT = 227;
const int CLASS_TYPE_NATURALIST = 220;
const int CLASS_TYPE_NIGHTSHADE = 116;
const int CLASS_TYPE_NINJA_SPY = 54;
const int CLASS_TYPE_OCULAR = 51;
const int CLASS_TYPE_OOZEMASTER = 101;
const int CLASS_TYPE_ORC_WARLORD = 181;
const int CLASS_TYPE_ORCUS = 163;
const int CLASS_TYPE_OUTLAW_CRIMSON_ROAD = 109;
const int CLASS_TYPE_PEERLESS = 159;
const int CLASS_TYPE_PNP_SHIFTER = 91;
const int CLASS_TYPE_PROPHET = 223;
const int CLASS_TYPE_PROTECTOR = 211;
const int CLASS_TYPE_PUPPET_MASTER = 218;
const int CLASS_TYPE_RAVAGER = 133;
const int CLASS_TYPE_RED_AVENGER = 82;
const int CLASS_TYPE_RED_WIZARD = 150;
const int CLASS_TYPE_RUNESCARRED = 134;
const int CLASS_TYPE_SACREDFIST = 126;
const int CLASS_TYPE_SAMURAI = 55;
const int CLASS_TYPE_SCOUT = 207;
const int CLASS_TYPE_SHADOW_ADEPT = 117;
const int CLASS_TYPE_SHADOWLORD = 120;
const int CLASS_TYPE_SHAMAN = 224;
const int CLASS_TYPE_SHINING_BLADE = 166;
const int CLASS_TYPE_SHOU = 164;
const int CLASS_TYPE_SOLDIER_OF_LIGHT = 118;
const int CLASS_TYPE_SPELLSWORD = 67;
const int CLASS_TYPE_STORMLORD = 86;
const int CLASS_TYPE_SUMMONER = 212;
const int CLASS_TYPE_SWASHBUCKLER = 232;
const int CLASS_TYPE_TEMPEST = 178;
const int CLASS_TYPE_TEMPLE_RAIDER = 110;
const int CLASS_TYPE_TEMPUS = 123;
const int CLASS_TYPE_THAYAN_KNIGHT = 149;
const int CLASS_TYPE_TRUENECRO = 151;
const int CLASS_TYPE_ULTIMATE_RANGER = 115;
const int CLASS_TYPE_VASSAL = 89;
const int CLASS_TYPE_VIGILANT = 85;
const int CLASS_TYPE_WARLORD = 206;
const int CLASS_TYPE_WARPRIEST = 56;
const int CLASS_TYPE_WEREWOLF = 173;
const int CLASS_TYPE_WITCH_DOCTOR = 225;
const int CLASS_TYPE_XENOWIZARD = 219;
const int CLASS_TYPE_PSION = 145;
const int CLASS_TYPE_PSYWARRIOR = 146;
const int CLASS_TYPE_SOULKNIFE = 147;
const int CLASS_TYPE_WILDER = 148;

Binary file not shown.

53
_removed/prc_levelup.nss Normal file
View File

@@ -0,0 +1,53 @@
/*
Put into: OnLevelup Event
*/
//:://////////////////////////////////////////////
//:: Created By: Stratovarius and DarkGod
//:: Created On: 2003-07-16
//:://////////////////////////////////////////////
//Added hook into EvalPRCFeats event
// Aaon Graywolf - Jan 6, 2004
//Added delay to EvalPRCFeats event to allow module setup to take priority
// Aaon Graywolf - Jan 6, 2004
#include "x2_inc_switches"
#include "prc_inc_function"
#include "inc_item_props"
void PrcFeats(object oPC)
{
EvalPRCFeats(oPC);
if (GetLevelByClass(CLASS_TYPE_WEREWOLF, oPC) > 0)
{
ExecuteScript("prc_wwunpoly", oPC);
}
}
void main()
{
object oPC = GetPCLevellingUp();
object oSkin = GetPCSkin(oPC);
ScrubPCSkin(oPC, oSkin);
DeletePRCLocalInts(oSkin);
//All of the PRC feats have been hooked into EvalPRCFeats
//The code is pretty similar, but much more modular, concise
//And easy to maintain.
// - Aaon Graywolf
DelayCommand(0.1, PrcFeats(oPC));
// Check to see which special prc requirements (i.e. those that can't be done)
// through the .2da's, the newly leveled up player meets.
ExecuteScript("prc_prereq", oPC);
ExecuteScript("prc_enforce_feat", oPC);
//Restore Power Points for Psionics
ExecuteScript("prc_psi_ppoints", oPC);
ExecuteScript("prc_enforce_psi", oPC);
DelayCommand(1.0, FeatSpecialUsePerDay(oPC));
// These scripts fire events that should only happen on levelup
ExecuteScript("prc_vassal_treas", oPC);
}

BIN
_removed/prc_tn_dk.uti Normal file

Binary file not shown.

62
_removed/prc_unequip.nss Normal file
View File

@@ -0,0 +1,62 @@
//::///////////////////////////////////////////////
//:: Example XP2 OnItemEquipped
//:: x2_mod_def_unequ
//:: (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
Put into: OnUnEquip Event
*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-07-16
//:://////////////////////////////////////////////
#include "x2_inc_switches"
#include "x2_inc_intweapon"
#include "inc_item_props"
#include "prc_inc_function"
void PrcFeats(object oPC)
{
SetLocalInt(oPC,"ONEQUIP",1);
EvalPRCFeats(oPC);
DelayCommand(0.2, DeleteLocalInt(oPC,"ONEQUIP"));
}
//Added hook into EvalPRCFeats event
// Aaon Graywolf - 6 Jan 2004
//Added delay to EvalPRCFeats event to allow module setup to take priority
// Aaon Graywolf - Jan 6, 2004
void main()
{
object oItem = GetPCItemLastUnequipped();
object oPC = GetPCItemLastUnequippedBy();
// -------------------------------------------------------------------------
// Intelligent Weapon System
// -------------------------------------------------------------------------
if (IPGetIsIntelligentWeapon(oItem))
{
IWSetIntelligentWeaponEquipped(oPC,OBJECT_INVALID);
IWPlayRandomUnequipComment(oPC,oItem);
}
PrcFeats(oPC);
// -------------------------------------------------------------------------
// Generic Item Script Execution Code
// If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module,
// it will execute a script that has the same name as the item's tag
// inside this script you can manage scripts for all events by checking against
// GetUserDefinedItemEventNumber(). See x2_it_example.nss
// -------------------------------------------------------------------------
if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
{
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_UNEQUIP);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet == X2_EXECUTE_SCRIPT_END)
{
return;
}
}
}

602
_removed/x0_i0_match.nss Normal file
View File

@@ -0,0 +1,602 @@
//:://////////////////////////////////////////////////
//:: X0_I0_MATCH
/*
Library for 'matching' functions. These functions
check to see whether a given value matches one of a long
set of constants, so they're simple but big and ugly.
*/
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 01/21/2003
//:: Updated By: Georg Zoeller, 2003/10/20
//:://////////////////////////////////////////////////
/**********************************************************************
* CONSTANTS
**********************************************************************/
//Talent Type Constants
int NW_TALENT_PROTECT = 1;
int NW_TALENT_ENHANCE = 2;
/**********************************************************************
* FUNCTION PROTOTYPES
**********************************************************************/
// Used to break protections into 3 categories:
// COMBAT, SPELL and ELEMENTAL.
// sClass should be one of: FIGHTER, CLERIC, MAGE, MONSTER
// nType should always be: NW_TALENT_PROTECT
int GetMatchCompatibility(talent tUse, string sClass, int nType);
// * Do I have any effect on me that came from a mind affecting spell?
int MatchDoIHaveAMindAffectingSpellOnMe(object oTarget);
// * if the passed in spell is an area of effect spell of any kind
int MatchAreaOfEffectSpell(int nSpell);
// * Is this spell a combat protection spells?
int MatchCombatProtections(talent tUse);
// * Is this talent a protection against spells?
int MatchSpellProtections(talent tUse);
// * Is this talent a protection against elemental damage?
int MatchElementalProtections(talent tUse);
// * Is this item a single-handed weapon?
int MatchSingleHandedWeapon(object oItem);
// TRUE if the item is a double-handed weapon
int MatchDoubleHandedWeapon(object oItem);
// TRUE if the item is a melee weapon
int MatchMeleeWeapon(object oItem);
// TRUE if the item is a shield
int MatchShield(object oItem);
// True if the item is a crossbow
int MatchCrossbow(object oItem);
// True if the item is a longbow or shortbow
int MatchNormalBow(object oItem);
// * is this a mind affecting spell?
int MatchMindAffectingSpells(int iSpell);
// * is this a charm type spell?
int MatchPersonSpells(int iSpell);
// True if this spell is one of the Reverse Healing touch Attacks
int MatchInflictTouchAttack(int nSpell);
// True if the creature is an elemental, undead, or golem
int MatchNonliving(int nRacialType);
// Checks that the melee talent being used
// is Disarm and if so then if the target has a
// weapon.
//
// This should return TRUE if:
// - we are not trying to use disarm
// - we are using disarm appropriately
//
// This should return FALSE if:
// - we are trying to use disarm on an inappropriate target
// - we are using disarm too frequently
//
// If this returns FALSE, we will fall back to a standard
// melee attack instead.
int VerifyDisarm(talent tUse, object oTarget);
// Makes sure that certain talents are not used
// on Elementals, Undead or Constructs
int VerifyCombatMeleeTalent(talent tUse, object oTarget);
// Checks the target for a specific EFFECT_TYPE constant value
int GetHasEffect(int nEffectType, object oTarget = OBJECT_SELF);
// Returns a potential removal spell that might be useful in
// this situation.
// This is not yet defined.
// int GetRemovalSpell();
/**********************************************************************
* FUNCTION DEFINITIONS
**********************************************************************/
//::///////////////////////////////////////////////
//:: Protection Matching Functions
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
These three functions break protections into
3 categories COMBAT, SPELL and ELEMENTAL
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 4, 2002
//:://////////////////////////////////////////////
int GetMatchCompatibility(talent tUse, string sClass, int nType)
{
int bValid;
if(nType == NW_TALENT_PROTECT)
{
if(sClass == "FIGHTER")
{
if(MatchCombatProtections(tUse))
{
bValid = TRUE;
}
}
else if(sClass == "MAGE")
{
if(MatchSpellProtections(tUse))
{
bValid = TRUE;
}
else if(MatchElementalProtections(tUse))
{
bValid = TRUE;
}
}
else if(sClass == "CLERIC" || sClass == "MONSTER")
{
if(MatchCombatProtections(tUse))
{
bValid = TRUE;
}
else if(MatchElementalProtections(tUse))
{
bValid = TRUE;
}
}
}
return bValid;
}
int MatchCombatProtections(talent tUse)
{
int nIndex = GetIdFromTalent(tUse);
if(nIndex == SPELL_PREMONITION ||
nIndex == SPELL_ELEMENTAL_SHIELD ||
nIndex == SPELL_GREATER_STONESKIN ||
nIndex == SPELL_SHADOW_SHIELD ||
nIndex == SPELL_ETHEREAL_VISAGE ||
nIndex == SPELL_STONESKIN ||
nIndex == SPELL_GHOSTLY_VISAGE ||
nIndex == SPELL_MESTILS_ACID_SHEATH ||
nIndex == SPELL_DEATH_ARMOR||
nIndex == 695 // epic warding
)
{
return TRUE;
}
return FALSE;
}
int MatchSpellProtections(talent tUse)
{
int nIndex = GetIdFromTalent(tUse);
if(nIndex == SPELL_GREATER_SPELL_MANTLE ||
nIndex == SPELL_SPELL_MANTLE ||
nIndex == SPELL_LESSER_SPELL_MANTLE ||
nIndex == SPELL_SHADOW_SHIELD ||
nIndex == SPELL_GLOBE_OF_INVULNERABILITY ||
nIndex == SPELL_MINOR_GLOBE_OF_INVULNERABILITY ||
nIndex == SPELL_ETHEREAL_VISAGE ||
nIndex == SPELL_GHOSTLY_VISAGE ||
nIndex == SPELL_SPELL_RESISTANCE ||
nIndex == SPELL_PROTECTION_FROM_SPELLS ||
nIndex == SPELL_NEGATIVE_ENERGY_PROTECTION )
{
return TRUE;
}
return FALSE;
}
// * if the passed in spell is an area of effect spell of any kind
int MatchAreaOfEffectSpell(int nSpell)
{
int nMatch = FALSE;
switch (nSpell)
{
case SPELL_ACID_FOG : nMatch = TRUE;break;
case SPELL_MIND_FOG : nMatch = TRUE; break;
case SPELL_STORM_OF_VENGEANCE: nMatch = TRUE; break;
// case SPELL_WEB : nMatch = TRUE; break;
case SPELL_GREASE : nMatch = TRUE; break;
case SPELL_CREEPING_DOOM : nMatch = TRUE; break;
// case SPELL_DARKNESS : nMatch = TRUE; break;
case SPELL_SILENCE : nMatch = TRUE; break;
case SPELL_BLADE_BARRIER : nMatch = TRUE; break;
case SPELL_CLOUDKILL : nMatch = TRUE; break;
case SPELL_STINKING_CLOUD : nMatch = TRUE; break;
case SPELL_WALL_OF_FIRE : nMatch = TRUE; break;
case SPELL_INCENDIARY_CLOUD : nMatch = TRUE; break;
case SPELL_ENTANGLE : nMatch = TRUE; break;
case SPELL_EVARDS_BLACK_TENTACLES: nMatch = TRUE; break;
case SPELL_CLOUD_OF_BEWILDERMENT : nMatch = TRUE; break;
case SPELL_STONEHOLD : nMatch = TRUE; break;
case SPELL_VINE_MINE : nMatch = TRUE; break;
case SPELL_SPIKE_GROWTH : nMatch = TRUE; break;
case SPELL_DIRGE : nMatch = TRUE; break;
case 530 : nMatch = TRUE; break; // vine mine
case 531 : nMatch = TRUE; break; // vine mine
case 532 : nMatch = TRUE; break; // vine mine
}
return nMatch;
}
int MatchElementalProtections(talent tUse)
{
int nIndex = GetIdFromTalent(tUse);
if(nIndex == SPELL_ENERGY_BUFFER ||
nIndex == SPELL_PROTECTION_FROM_ELEMENTS ||
nIndex == SPELL_RESIST_ELEMENTS ||
nIndex == SPELL_ENDURE_ELEMENTS)
{
return TRUE;
}
return FALSE;
}
// * Returns a potential removal spell that might be useful in this situation
int GetRemovalSpell()
{
if (GetHasSpell(SPELL_DISPEL_MAGIC, OBJECT_SELF) == TRUE) return SPELL_DISPEL_MAGIC;
if (GetHasSpell(SPELL_LESSER_DISPEL, OBJECT_SELF) == TRUE) return SPELL_LESSER_DISPEL;
if (GetHasSpell(SPELL_GREATER_DISPELLING, OBJECT_SELF) == TRUE) return SPELL_GREATER_DISPELLING;
if (GetHasSpell(SPELL_MORDENKAINENS_DISJUNCTION, OBJECT_SELF) == TRUE) return SPELL_MORDENKAINENS_DISJUNCTION;
return -1;
}
// * Do I have any effect on me that came from a mind affecting spell?
int MatchDoIHaveAMindAffectingSpellOnMe(object oTarget)
{
if (
GetHasSpellEffect(SPELL_SLEEP, oTarget) ||
GetHasSpellEffect(SPELL_DAZE, oTarget) ||
GetHasSpellEffect(SPELL_HOLD_ANIMAL, oTarget) ||
GetHasSpellEffect(SPELL_HOLD_MONSTER, oTarget) ||
GetHasSpellEffect(SPELL_HOLD_PERSON, oTarget) ||
GetHasSpellEffect(SPELL_CHARM_MONSTER, oTarget) ||
GetHasSpellEffect(SPELL_CHARM_PERSON, oTarget) ||
GetHasSpellEffect(SPELL_CHARM_PERSON_OR_ANIMAL, oTarget) ||
GetHasSpellEffect(SPELL_MASS_CHARM, oTarget) ||
GetHasSpellEffect(SPELL_DOMINATE_ANIMAL, oTarget) ||
GetHasSpellEffect(SPELL_DOMINATE_MONSTER, oTarget) ||
GetHasSpellEffect(SPELL_DOMINATE_PERSON, oTarget) ||
GetHasSpellEffect(SPELL_CONFUSION, oTarget) ||
GetHasSpellEffect(SPELL_MIND_FOG, oTarget) ||
GetHasSpellEffect(SPELL_CLOUD_OF_BEWILDERMENT, oTarget) ||
GetHasSpellEffect(SPELLABILITY_BOLT_DOMINATE,oTarget) ||
GetHasSpellEffect(SPELLABILITY_BOLT_CHARM,oTarget) ||
GetHasSpellEffect(SPELLABILITY_BOLT_CONFUSE,oTarget) ||
GetHasSpellEffect(SPELLABILITY_BOLT_DAZE,oTarget)
)
return TRUE;
return FALSE;
}
// Paus
int MatchMindAffectingSpells(int iSpell)
{
switch (iSpell) {
case SPELL_SLEEP:
case SPELL_DAZE:
case SPELL_HOLD_ANIMAL:
case SPELL_HOLD_MONSTER:
case SPELL_HOLD_PERSON:
case SPELL_CHARM_MONSTER:
case SPELL_CHARM_PERSON:
case SPELL_CHARM_PERSON_OR_ANIMAL:
case SPELL_MASS_CHARM:
case SPELL_DOMINATE_ANIMAL:
case SPELL_DOMINATE_MONSTER:
case SPELL_DOMINATE_PERSON:
case SPELL_CONFUSION:
case SPELL_SPHERE_OF_CHAOS:
case SPELL_CLOAK_OF_CHAOS:
case SPELL_MIND_FOG:
case SPELL_CLOUD_OF_BEWILDERMENT:
return TRUE; break;
default: break;
}
return FALSE;
}
// Paus
int MatchPersonSpells(int iSpell) {
switch (iSpell) {
case SPELL_HOLD_PERSON:
case SPELL_CHARM_PERSON:
case SPELL_DOMINATE_PERSON:
return TRUE; break;
default: break;
}
return FALSE;
}
int MatchSingleHandedWeapon(object oItem)
{
switch (GetBaseItemType(oItem)) {
case BASE_ITEM_BATTLEAXE:
case BASE_ITEM_CLUB:
case BASE_ITEM_DAGGER:
case BASE_ITEM_HANDAXE:
case BASE_ITEM_KAMA:
case BASE_ITEM_KATANA:
case BASE_ITEM_KUKRI:
case BASE_ITEM_LIGHTFLAIL:
case BASE_ITEM_HEAVYFLAIL:
case BASE_ITEM_LIGHTHAMMER:
case BASE_ITEM_LIGHTMACE:
case BASE_ITEM_LONGSWORD:
case BASE_ITEM_MORNINGSTAR:
case BASE_ITEM_BASTARDSWORD:
case BASE_ITEM_RAPIER:
case BASE_ITEM_SICKLE:
case BASE_ITEM_DWARVENWARAXE:
case BASE_ITEM_SCIMITAR:
case BASE_ITEM_WHIP:
case BASE_ITEM_SHORTSWORD:
case BASE_ITEM_WARHAMMER: return TRUE;
break;
default: break;
}
return FALSE;
}
// TRUE if the item is a double-handed weapon
int MatchDoubleHandedWeapon(object oItem)
{
switch (GetBaseItemType(oItem)) {
case BASE_ITEM_DIREMACE:
case BASE_ITEM_DOUBLEAXE:
case BASE_ITEM_GREATAXE:
case BASE_ITEM_GREATSWORD:
case BASE_ITEM_HALBERD:
case BASE_ITEM_MAGICSTAFF:
case BASE_ITEM_QUARTERSTAFF:
case BASE_ITEM_TWOBLADEDSWORD:
return TRUE;
}
return FALSE;
}
// TRUE if the item is a melee weapon
int MatchMeleeWeapon(object oItem)
{
return (MatchSingleHandedWeapon(oItem) || MatchDoubleHandedWeapon(oItem));
}
// TRUE if the item is a shield
int MatchShield(object oItem)
{
switch (GetBaseItemType(oItem)) {
case BASE_ITEM_SMALLSHIELD:
case BASE_ITEM_LARGESHIELD:
case BASE_ITEM_TOWERSHIELD:
return TRUE;
}
return FALSE;
}
// True if the item is a crossbow
int MatchCrossbow(object oItem)
{
switch (GetBaseItemType(oItem)) {
case BASE_ITEM_HEAVYCROSSBOW:
case BASE_ITEM_LIGHTCROSSBOW:
return TRUE;
}
return FALSE;
}
// True if the item is a longbow or shortbow
int MatchNormalBow(object oItem)
{
switch (GetBaseItemType(oItem)) {
case BASE_ITEM_LONGBOW:
case BASE_ITEM_SHORTBOW:
return TRUE;
}
return FALSE;
}
// True if this spell is one of the Reverse Healing touch Attacks
int MatchInflictTouchAttack(int nSpell)
{
int nMatch = FALSE;
switch (nSpell)
{
case SPELL_INFLICT_CRITICAL_WOUNDS:
case SPELL_INFLICT_LIGHT_WOUNDS:
case SPELL_INFLICT_MINOR_WOUNDS:
case SPELL_INFLICT_MODERATE_WOUNDS:
case SPELL_INFLICT_SERIOUS_WOUNDS:
case SPELL_HARM: nMatch = TRUE; break;
}
return nMatch;
}
// True if the creature is an elemental, undead, or golem
int MatchNonliving(int nRacialType)
{
int nMatch = FALSE;
switch (nRacialType)
{
case RACIAL_TYPE_CONSTRUCT:
case RACIAL_TYPE_ELEMENTAL:
case RACIAL_TYPE_UNDEAD: nMatch = TRUE; break;
}
return nMatch;
}
//::///////////////////////////////////////////////
//:: Verify Disarm
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
// Checks that the melee talent being used
// is Disarm and if so then if the target has a
// weapon.
//
// This should return TRUE if:
// - we are not trying to use disarm
// - we are using disarm appropriately
//
// This should return FALSE if:
// - we are trying to use disarm on an inappropriate target
// - we are using disarm too frequently
//
// If this returns FALSE, we will fall back to a standard
// melee attack instead.
int VerifyDisarm(talent tUse, object oTarget)
{
if(GetTypeFromTalent(tUse) == TALENT_TYPE_FEAT
&& GetIdFromTalent(tUse) == FEAT_DISARM)
{
// * If the creature is not capable of being disarmed
// * don't waste time trying to do so
// * October 3, Brent
if (GetIsCreatureDisarmable(oTarget) == FALSE)
{
return FALSE;
}
// * the associates given Disarm were given it intentionally
// * they try to use this ability as often as possible
int bIsAssociate = FALSE;
if (GetIsObjectValid(GetMaster()) == TRUE)
{
bIsAssociate = TRUE;
}
// * disarm happens infrequently
if (d10() > 4 && bIsAssociate == FALSE) return FALSE;
object oSlot1 = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oTarget);
object oSlot2 = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget);
object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND);
object oWeapon2 = GetItemInSlot(INVENTORY_SLOT_LEFTHAND);
if(GetIsObjectValid(oSlot1) || GetIsObjectValid(oSlot2))
{
if(GetIsObjectValid(oWeapon) && !GetWeaponRanged(oWeapon))
{
// Enemy has a weapon and so do we
return TRUE;
}
else if (GetIsObjectValid(oWeapon2) && !GetWeaponRanged(oWeapon2))
{
// ditto
return TRUE;
} else {
// they've got something, but we don't!
// BK Changed this to return true. Creatures that do not
// carry weapons should still be capable of disarming
// people. If you don't want an unarmed creature to attempt
// a disarm, then don't give it the disarm feat in the first place.
return TRUE;
}
} else {
// they don't have anything to disarm!
return FALSE;
}
}
// We're not trying to use disarm, everything's OK
return TRUE;
}
//::///////////////////////////////////////////////
//:: Verify Melee Talent Use
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Makes sure that certain talents are not used
on Elementals, Undead or Constructs
- December 18 2002: Do not use smite evil on good people
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 23, 2002
//:://////////////////////////////////////////////
int VerifyCombatMeleeTalent(talent tUse, object oTarget)
{
int nFeatID = GetIdFromTalent(tUse);
if(nFeatID == FEAT_SAP ||
nFeatID == FEAT_STUNNING_FIST)
{
int nRacial = GetRacialType(oTarget);
if(nRacial == RACIAL_TYPE_CONSTRUCT ||
nRacial == RACIAL_TYPE_UNDEAD ||
nRacial == RACIAL_TYPE_ELEMENTAL ||
nRacial == RACIAL_TYPE_VERMIN)
{
return FALSE;
}
} else if (nFeatID = FEAT_SMITE_EVIL) {
int nAlign = GetAlignmentGoodEvil(oTarget);
if (nAlign == ALIGNMENT_GOOD)
return FALSE;
} else if (nFeatID = FEAT_SMITE_GOOD) {
int nAlign = GetAlignmentGoodEvil(oTarget);
if (nAlign == ALIGNMENT_EVIL)
return FALSE;
}
return TRUE;
}
//::///////////////////////////////////////////////
//:: Get Has Effect
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Checks to see if the target has a given
spell effect
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 26, 2001
//:://////////////////////////////////////////////
int GetHasEffect(int nEffectType, object oTarget = OBJECT_SELF)
{
effect eCheck = GetFirstEffect(oTarget);
while(GetIsEffectValid(eCheck))
{
if(GetEffectType(eCheck) == nEffectType)
{
return TRUE;
}
eCheck = GetNextEffect(oTarget);
}
return FALSE;
}
/* void main() {} /* */

1760
_removed/x0_i0_spells.nss Normal file

File diff suppressed because it is too large Load Diff

1176
_removed/x0_i0_treasure.nss Normal file

File diff suppressed because it is too large Load Diff

BIN
_removed/x0_s0_inflict.ncs Normal file

Binary file not shown.

View File

@@ -0,0 +1,56 @@
//::///////////////////////////////////////////////
//:: [Inflict Wounds]
//:: [X0_S0_Inflict.nss]
//:: Copyright (c) 2002 Bioware Corp.
//:://////////////////////////////////////////////
//:: This script is used by all the inflict spells
//::
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: July 2002
//:://////////////////////////////////////////////
//:: VFX Pass By:
//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff
#include "prc_alterations"
#include "X0_I0_SPELLS" // * this is the new spells include for expansion packs
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
int nSpellID = GetSpellId();
switch (nSpellID)
{
/*Minor*/ case 431: spellsInflictTouchAttack(1, 0, 1, 246, VFX_IMP_HEALING_G, nSpellID); break;
/*Light*/ case 432: case 609: spellsInflictTouchAttack(d8(), 5, 8, 246, VFX_IMP_HEALING_G, nSpellID); break;
/*Moderate*/ case 433: case 610: spellsInflictTouchAttack(d8(2), 10, 16, 246, VFX_IMP_HEALING_G, nSpellID); break;
/*Serious*/ case 434: case 611: spellsInflictTouchAttack(d8(3), 15, 24, 246, VFX_IMP_HEALING_G, nSpellID); break;
/*Critical*/ case 435: case 612: spellsInflictTouchAttack(d8(4), 20, 32, 246, VFX_IMP_HEALING_G, nSpellID); break;
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Erasing the variable used to store the spell's spell school
}

BIN
_removed/x0_s0_sunburst.ncs Normal file

Binary file not shown.

167
_removed/x0_s0_sunburst.nss Normal file
View File

@@ -0,0 +1,167 @@
//::///////////////////////////////////////////////
//:: Sunburst
//:: X0_S0_Sunburst
//:: Copyright (c) 2002 Bioware Corp.
//:://////////////////////////////////////////////
/*
// Brilliant globe of heat
// All creatures in the globe are blinded and
// take 6d6 damage
// Undead creatures take 1d6 damage (max 25d6)
// The blindness is permanent unless cast to remove it
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: July 23 2002
//:://////////////////////////////////////////////
//:: Last Updated By: Andrew Nobbs May 14, 2003
//:: Notes: Changed damage to non-undead to 6d6
//:: 2003-10-09: GZ Added Subrace check for vampire special case, bugfix
//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff
#include "spinc_common"
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
float nSize = RADIUS_SIZE_COLOSSAL;
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oCaster = OBJECT_SELF;
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
int nCasterLvl = CasterLvl;
int nMetaMagic = GetMetaMagicFeat();
int nDamage = 0;
float fDelay;
effect eExplode = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_HOLY);
effect eHitVis = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE);
effect eLOS = EffectVisualEffect(VFX_FNF_LOS_HOLY_30);
effect eDam;
//Get the spell target location as opposed to the spell target.
location lTarget = GetSpellTargetLocation();
//Limit Caster level for the purposes of damage
if (nCasterLvl > 25)
{
nCasterLvl = 25;
}
int nPenetr = CasterLvl + SPGetPenetr();
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eLOS, GetSpellTargetLocation());
int bDoNotDoDamage = FALSE;
//Declare the spell shape, size and the location. Capture the first target object in the shape.
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, nSize, lTarget, TRUE, OBJECT_TYPE_CREATURE);
//Cycle through the targets within the spell shape until an invalid object is captured.
while (GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SUNBURST));
//This visual effect is applied to the target object not the location as above. This visual effect
//represents the flame that erupts on the target not on the ground.
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHitVis, oTarget);
if (!MyPRCResistSpell(OBJECT_SELF, oTarget,nPenetr, fDelay))
{
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
{
//Roll damage for each target
nDamage = MyMaximizeOrEmpower(6, nCasterLvl, nMetaMagic);
}
else
{
nDamage = MyMaximizeOrEmpower(6, 6, nMetaMagic);
}
int nDC = GetChangesToSaveDC(oTarget,OBJECT_SELF);
// * if a vampire then destroy it
if (GetAppearanceType(oTarget) == APPEARANCE_TYPE_VAMPIRE_MALE || GetAppearanceType(oTarget) == APPEARANCE_TYPE_VAMPIRE_FEMALE || GetStringLowerCase(GetSubRace(oTarget)) == "vampire" )
{
// SpeakString("I vampire");
// * if reflex saving throw fails no blindness
if (!ReflexSave(oTarget, (GetSpellSaveDC() + nDC), SAVING_THROW_TYPE_SPELL))
{
effect eDead = EffectDamage(GetCurrentHitPoints(oTarget));
//SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
//Apply epicenter explosion on caster
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eExplode, oTarget);
DelayCommand(0.5, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDead, oTarget));
bDoNotDoDamage = TRUE;
}
}
if (bDoNotDoDamage == FALSE)
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, (GetSpellSaveDC() + GetChangesToSaveDC(oTarget,OBJECT_SELF)), SAVING_THROW_TYPE_SPELL);
// * Do damage
if ((nDamage > 0) && (bDoNotDoDamage == FALSE))
{
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL);
// Apply effects to the currently selected target.
DelayCommand(0.01, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
// * if reflex saving throw fails apply blindness
if (!ReflexSave(oTarget, (GetSpellSaveDC() + GetChangesToSaveDC(oTarget,OBJECT_SELF)), SAVING_THROW_TYPE_SPELL))
{
effect eBlindness = EffectBlindness();
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eBlindness, oTarget,0.0f,TRUE,-1,CasterLvl);
}
} // nDamage > 0
}
//-----------------------------------------------------------------
// GZ: Bugfix, reenable damage for next object
//-----------------------------------------------------------------
bDoNotDoDamage = FALSE;
}
//Select the next target within the spell shape.
oTarget = MyNextObjectInShape(SHAPE_SPHERE, nSize, lTarget, TRUE, OBJECT_TYPE_CREATURE);
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Erasing the variable used to store the spell's spell school
}

BIN
_removed/x0_s3_holy.ncs Normal file

Binary file not shown.

31
_removed/x0_s3_holy.nss Normal file
View File

@@ -0,0 +1,31 @@
//::///////////////////////////////////////////////
//:: Holy Water
//:: x0_s3_holy
//:: Copyright (c) 2002 Bioware Corp.
//:://////////////////////////////////////////////
/*
Grenade.
Fires at a target. If hit, the target takes
direct damage. If missed, all enemies within
an area of effect take splash damage.
HOWTO:
- If target is valid attempt a hit
- If miss then MISS
- If hit then direct damage
- If target is invalid or MISS
- have area of effect near target
- everyone in area takes splash damage
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: September 10, 2002
//:://////////////////////////////////////////////
//#include "X0_I0_SPELLS" //included in f_vampire_holy_h
#include "f_vampire_holy_h"
void main()
{
DoVampireGrenade(d4(2),1, VFX_IMP_HEAD_HOLY, VFX_FNF_LOS_NORMAL_20, DAMAGE_TYPE_DIVINE, RADIUS_SIZE_HUGE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, RACIAL_TYPE_UNDEAD);
}

View File

@@ -0,0 +1,133 @@
//::///////////////////////////////////////////////
//:: x2_s0_cureother
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cure Critical Wounds on Others - causes 5 points
of damage to the spell caster as well.
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Warner
//:: Created On: Jan 2/03
//:://////////////////////////////////////////////
//:: modified by mr_bumpkin Dec 4, 2003 for prc stuff
#include "spinc_common"
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
/*
Spellcast Hook Code
Added 2003-07-07 by Georg Zoeller
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
int nHeal;
int nDamage = d8(4);
int nMetaMagic = GetMetaMagicFeat();
effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eVis2 = EffectVisualEffect(VFX_IMP_SUPER_HEROISM);
effect eHeal, eDam;
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
int nExtraDamage = CasterLvl; // * figure out the bonus damage
if (nExtraDamage > 20)
{
nExtraDamage = 20;
}
// * if low or normal difficulty is treated as MAXIMIZED
if(GetIsPC(oTarget) && GetGameDifficulty() < GAME_DIFFICULTY_CORE_RULES)
{
nDamage = 32 + nExtraDamage;
}
else
{
nDamage = nDamage + nExtraDamage;
}
CasterLvl +=SPGetPenetr();
//Make metamagic checks
if (CheckMetaMagic(nMetaMagic, METAMAGIC_MAXIMIZE))
{
nDamage = 8 + nExtraDamage;
// * if low or normal difficulty then MAXMIZED is doubled.
if(GetIsPC(OBJECT_SELF) && GetGameDifficulty() < GAME_DIFFICULTY_CORE_RULES)
{
nDamage = nDamage + nExtraDamage;
}
}
if (nMetaMagic == METAMAGIC_EMPOWER || GetHasFeat(FEAT_HEALING_DOMAIN_POWER))
{
nDamage = nDamage + (nDamage/2);
}
if (MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
if (oTarget != OBJECT_SELF)
{
//Figure out the amount of damage to heal
nHeal = nDamage;
//Set the heal effect
eHeal = EffectHeal(nHeal);
//Apply heal effect and VFX impact
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
//Apply Damage Effect to the Caster
SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(5), OBJECT_SELF);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 31, FALSE));
}
}
//Check that the target is undead
else
{
int nTouch = TouchAttackMelee(oTarget);
if (nTouch > 0)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 31));
if (!MyPRCResistSpell(OBJECT_SELF, oTarget,CasterLvl))
{
eDam = EffectDamage(nDamage,DAMAGE_TYPE_NEGATIVE);
//Apply the VFX impact and effects
DelayCommand(1.0, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
//Apply Damage Effect to the Caster
SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(5), OBJECT_SELF);
}
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Erasing the variable used to store the spell's spell school
}

167
_removed/x2_s0_undeath.nss Normal file
View File

@@ -0,0 +1,167 @@
//::///////////////////////////////////////////////
//:: Undeath to Death
//:: X2_S0_Undeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This spell slays 1d4 HD worth of undead creatures
per caster level (maximum 20d4). Creatures with
the fewest HD are affected first;
*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: August 13,2003
//:://////////////////////////////////////////////
//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff
#include "spinc_common"
#include "NW_I0_SPELLS"
#include "x0_i0_spells"
#include "x2_inc_toollib"
#include "x2_inc_spellhook"
void DoUndeadToDeath(object oCreature,int CasterLvl)
{
SignalEvent(oCreature, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
SetLocalInt(oCreature,"X2_EBLIGHT_I_AM_DEAD", TRUE);
if (!PRCMySavingThrow(SAVING_THROW_WILL,oCreature,(GetSpellSaveDC() + GetChangesToSaveDC(oCreature,OBJECT_SELF)),SAVING_THROW_TYPE_NONE,OBJECT_SELF))
{
float fDelay = GetRandomDelay(0.2f,0.4f);
if (!MyPRCResistSpell(OBJECT_SELF, oCreature,CasterLvl, fDelay))
{
effect eDeath = EffectDamage(GetCurrentHitPoints(oCreature),DAMAGE_TYPE_DIVINE,DAMAGE_POWER_ENERGY);
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
DelayCommand(fDelay+0.5f,SPApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oCreature));
DelayCommand(fDelay,SPApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oCreature));
}
else
{
DelayCommand(1.0f,DeleteLocalInt(oCreature,"X2_EBLIGHT_I_AM_DEAD"));
}
}
else
{
DelayCommand(1.0f,DeleteLocalInt(oCreature,"X2_EBLIGHT_I_AM_DEAD"));
}
}
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
/*
Spellcast Hook Code
Added 2003-07-07 by Georg Zoeller
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
int nMetaMagic = GetMetaMagicFeat();
// End of Spell Cast Hook
// Impact VFX
location lLoc = GetSpellTargetLocation();
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_STRIKE_HOLY),lLoc);
TLVFXPillar(VFX_FNF_LOS_HOLY_20, lLoc,3,0.0f);
// build list with affected creatures
// calculation
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
int nLevel = CasterLvl;
CasterLvl +=SPGetPenetr();
if (nLevel>20)
{
nLevel = 20;
}
// calculate number of hitdice affected
int nLow = 9999;
object oLow;
int nHDLeft = nLevel *d4();
//Enter Metamagic conditions
if (CheckMetaMagic(nMetaMagic, METAMAGIC_MAXIMIZE))
{
nHDLeft = 4 * PRCGetCasterLevel(OBJECT_SELF);//Damage is at max
}
if (CheckMetaMagic(nMetaMagic, METAMAGIC_EMPOWER))
{
nHDLeft += (nHDLeft/2); //Damage/Healing is +50%
}
int nCurHD;
object oFirst = MyFirstObjectInShape(SHAPE_SPHERE, 20.0f,lLoc );
// Only start loop if there is a creature in the area of effect
if (GetIsObjectValid(oFirst))
{
object oTarget = oFirst;
while (GetIsObjectValid(oTarget) && nHDLeft >0)
{
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
{
nCurHD = GetHitDice(oTarget);
if (nCurHD <= nHDLeft )
{
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
// ignore creatures already affected
if (GetLocalInt(oTarget,"X2_EBLIGHT_I_AM_DEAD") == 0 && !GetPlotFlag(oTarget) && !GetIsDead(oTarget))
{
// store the creature with the lowest HD
if (GetHitDice(oTarget) <= nLow)
{
nLow = GetHitDice(oTarget);
oLow = oTarget;
}
}
}
}
}
// Get next target
oTarget = MyNextObjectInShape(SHAPE_SPHERE, 20.0f ,lLoc);
// End of cycle, time to kill the lowest creature
if (!GetIsObjectValid(oTarget))
{
// we have a valid lowest creature we can affect with the remaining HD
if (GetIsObjectValid(oLow) && nHDLeft >= nLow)
{
DoUndeadToDeath(oLow,CasterLvl);
// decrement remaining HD
nHDLeft -= nLow;
// restart the loop
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, 20.0f, GetSpellTargetLocation());
}
// reset counters
oLow = OBJECT_INVALID;
nLow = 9999;
}
}
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Erasing the variable used to store the spell's spell school
}