Initial commit

Initial commit.
This commit is contained in:
Jaysyn904 2025-06-16 14:10:36 -04:00
parent 8048d08170
commit cdaa298e0b
4746 changed files with 5196730 additions and 18 deletions

View File

@ -1,14 +1,14 @@
# Default Module Template # The Ruins of Tcheou Cherng [PRC8-CEP2]
Repository for the development of the PRC8 version of ..... Repository for the development of the PRC8 version of The Ruins of Tcheou Cherng NWN module.
[Discussion Thread on Discord](https://discord.gg/ca2ru3KxYd) [Discussion Thread on Discord](https://discord.gg/ca2ru3KxYd)
[Original module]()
## Requirements ## Requirements
1.) [Nasher](https://github.com/squattingmonk/nasher), installed in your system path. 1.) [Nasher](https://github.com/squattingmonk/nasher), installed in your system path.
2.) [PRC8](https://gitea.raptio.us/Jaysyn/PRC8/src/branch/main/Release) 2.) [Original module resources](https://neverwintervault.org/project/nwn1/module/sks1-ruins-tcheou-cherng-0)
3.) [CEP3](https://neverwintervault.org/project/nwnee/hakpak/combined/cep-3-community-expansion-pack) 3.) [PRC8](https://gitea.raptio.us/Jaysyn/PRC8/src/branch/main/Release)
4.) [CEP2](https://neverwintervault.org/cep)

View File

@ -1,9 +1,9 @@
[package] [package]
name = "Default Module" name = "SKS01 - The Ruins of Tcheou Cherng [PRC8-CEP2]"
description = "PRC8 version of ..." description = "PRC8 version of The Ruins of Tcheou Cherng [PRC8-CEP2]."
version = "1.01prc8" version = "1.55prc8"
url = "https://discord.gg/ca2ru3KxYd" url = "https://discord.gg/ca2ru3KxYd"
author = "Original Author" author = "Vendalus "
author = "Jaysyn904 <68194417+Jaysyn904@users.noreply.github.com>" author = "Jaysyn904 <68194417+Jaysyn904@users.noreply.github.com>"
[package.sources] [package.sources]
@ -15,8 +15,8 @@ author = "Jaysyn904 <68194417+Jaysyn904@users.noreply.github.com>"
[target] [target]
name = "default" name = "default"
file = "Default Module.mod" file = "SKS01 - The Ruins of Tcheou Cherng [PRC8-CEP2].mod"
description = "PRC8 version of ..." description = "PRC8 version of The Ruins of Tcheou Cherng [PRC8-CEP2]."
[target.sources] [target.sources]
include = "src/module/**/*" include = "src/module/**/*"
include = "src/include/**/*" include = "src/include/**/*"
@ -227,13 +227,233 @@ description = "PRC8 version of ..."
filter = "x2_inc_cutscenep.nss" filter = "x2_inc_cutscenep.nss"
filter = "x2_inc_spellhook.nss" filter = "x2_inc_spellhook.nss"
filter = "x3_inc_horse.nss" filter = "x3_inc_horse.nss"
filter = "prc_inc_string.nss"
filter = "prc_nui_sc_inc.nss"
filter = "prc_nui_scd_inc.nss"
filter = "prc_nui_consts.nss"
filter = "nw_inc_nui"
filter = "xchst_inc.nss" filter = "xchst_inc.nss"
[target] [target]
name = "tophak" name = "tophak"
file = "HAKNAME.hak" file = "sks01_prc8_top.hak"
description = "PRC8 merge hakpak for PRC8 version of ..." description = "Merge hakpak for PRC8 version of The Ruins of Tcheou Cherng"
[target.sources] [target.sources]
include = "src/hakpak/HAKNAME/**/*" include = "src/hakpak/sks01_prc8_top/**/*"
include = "src/include/**/*"
filter = "bnd_inc_bndfunc.nss"
filter = "bnd_vestig_const.nss"
filter = "inc_2dacache.nss"
filter = "inc_abil_damage.nss"
filter = "inc_acp.nss"
filter = "inc_addragebonus.nss"
filter = "inc_area.nss"
filter = "inc_array_sort.nss"
filter = "inc_cache_setup.nss"
filter = "inc_debug.nss"
filter = "inc_dispel.nss"
filter = "inc_draw.nss"
filter = "inc_draw_prc.nss"
filter = "inc_draw_text.nss"
filter = "inc_draw_tools.nss"
filter = "inc_dynconv.nss"
filter = "inc_ecl.nss"
filter = "inc_epicspellai.nss"
filter = "inc_epicspelldef.nss"
filter = "inc_epicspellfnc.nss"
filter = "inc_epicspells.nss"
filter = "inc_eventhook.nss"
filter = "inc_heap.nss"
filter = "inc_item_props.nss"
filter = "inc_logmessage.nss"
filter = "inc_lookups.nss"
filter = "inc_metalocation.nss"
filter = "inc_newspellbook.nss"
filter = "inc_npc.nss"
filter = "inc_nwnx_funcs.nss"
filter = "inc_persistsql.nss"
filter = "inc_persist_loca.nss"
filter = "inc_pers_array.nss"
filter = "inc_poison.nss"
filter = "inc_prc_npc.nss"
filter = "inc_prc_poly.nss"
filter = "inc_rand_equip.nss"
filter = "inc_ravage.nss"
filter = "inc_rend.nss"
filter = "inc_sbr_readme.nss"
filter = "inc_set.nss"
filter = "inc_spirit_weapn.nss"
filter = "inc_sp_gain_mem.nss"
filter = "inc_sql.nss"
filter = "inc_switch_setup.nss"
filter = "inc_target_list.nss"
filter = "inc_threads.nss"
filter = "inc_time.nss"
filter = "inc_timestop.nss"
filter = "inc_uniqueid.nss"
filter = "inc_utility.nss"
filter = "inc_vfx_const.nss"
filter = "inv_inc_blast.nss"
filter = "inv_inc_invfunc.nss"
filter = "inv_inc_invknown.nss"
filter = "inv_inc_invoke.nss"
filter = "inv_invoc_const.nss"
filter = "inv_invokehook.nss"
filter = "lookup_2da_spell.nss"
filter = "moi_inc_moifunc.nss"
filter = "moi_meld_const.nss"
filter = "nw_o2_coninclude.nss"
filter = "pnp_lich_inc.nss"
filter = "pnp_shft_main.nss"
filter = "pnp_shft_poly.nss"
filter = "prcsp_archmaginc.nss"
filter = "prcsp_engine.nss"
filter = "prcsp_reputation.nss"
filter = "prc_add_spell_dc.nss"
filter = "prc_add_spl_pen.nss"
filter = "prc_allow_const.nss"
filter = "prc_alterations.nss"
filter = "prc_ccc_const.nss"
filter = "prc_ccc_readme.nss"
filter = "prc_class_const.nss"
filter = "prc_compan_inc.nss"
filter = "prc_craft_inc.nss"
filter = "prc_effect_inc.nss"
filter = "prc_feat_const.nss"
filter = "prc_getbest_inc.nss"
filter = "prc_inc_actions.nss"
filter = "prc_inc_array.nss"
filter = "prc_inc_assoc.nss"
filter = "prc_inc_breath.nss"
filter = "prc_inc_burn.nss"
filter = "prc_inc_castlvl.nss"
filter = "prc_inc_chat.nss"
filter = "prc_inc_chat_dm.nss"
filter = "prc_inc_chat_pow.nss"
filter = "prc_inc_chat_shf.nss"
filter = "prc_inc_clsfunc.nss"
filter = "prc_inc_combat.nss"
filter = "prc_inc_combmove.nss"
filter = "prc_inc_core.nss"
filter = "prc_inc_damage.nss"
filter = "prc_inc_descrptr.nss"
filter = "prc_inc_domain.nss"
filter = "prc_inc_dragsham.nss"
filter = "prc_inc_drugfunc.nss"
filter = "prc_inc_effect.nss"
filter = "prc_inc_factotum.nss"
filter = "prc_inc_fork.nss"
filter = "prc_inc_function.nss"
filter = "prc_inc_hextor.nss"
filter = "prc_inc_itmrstr.nss"
filter = "prc_inc_leadersh.nss"
filter = "prc_inc_listener.nss"
filter = "prc_inc_material.nss"
filter = "prc_inc_natweap.nss"
filter = "prc_inc_nat_hb.nss"
filter = "prc_inc_newip.nss"
filter = "prc_inc_nwscript.nss"
filter = "prc_inc_onhit.nss"
filter = "prc_inc_racial.nss"
filter = "prc_inc_sbheir.nss"
filter = "prc_inc_sb_const.nss"
filter = "prc_inc_scry.nss"
filter = "prc_inc_shifting.nss"
filter = "prc_inc_skills.nss"
filter = "prc_inc_skin.nss"
filter = "prc_inc_smite.nss"
filter = "prc_inc_sneak.nss"
filter = "prc_inc_spells.nss"
filter = "prc_inc_sp_tch.nss"
filter = "prc_inc_stunfist.nss"
filter = "prc_inc_switch.nss"
filter = "prc_inc_s_det.nss"
filter = "prc_inc_teleport.nss"
filter = "prc_inc_template.nss"
filter = "prc_inc_turning.nss"
filter = "prc_inc_unarmed.nss"
filter = "prc_inc_util.nss"
filter = "prc_inc_wpnrest.nss"
filter = "prc_ipfeat_const.nss"
filter = "prc_ip_srcost.nss"
filter = "prc_misc_const.nss"
filter = "prc_racial_const.nss"
filter = "prc_shifter_info.nss"
filter = "prc_spellf_inc.nss"
filter = "prc_spellhook.nss"
filter = "prc_spell_const.nss"
filter = "prc_sp_func.nss"
filter = "prc_template_con.nss"
filter = "prc_weap_apt.nss"
filter = "prc_x2_craft.nss"
filter = "prc_x2_itemprop.nss"
filter = "prgt_inc.nss"
filter = "prgt_inc_trap.nss"
filter = "psi_inc_ac_const.nss"
filter = "psi_inc_ac_convo.nss"
filter = "psi_inc_ac_manif.nss"
filter = "psi_inc_ac_spawn.nss"
filter = "psi_inc_augment.nss"
filter = "psi_inc_const.nss"
filter = "psi_inc_core.nss"
filter = "psi_inc_enrgypow.nss"
filter = "psi_inc_metapsi.nss"
filter = "psi_inc_onhit.nss"
filter = "psi_inc_powknown.nss"
filter = "psi_inc_ppoints.nss"
filter = "psi_inc_psicraft.nss"
filter = "psi_inc_psifunc.nss"
filter = "psi_inc_pwresist.nss"
filter = "psi_inc_soulkn.nss"
filter = "psi_power_const.nss"
filter = "psi_spellhook.nss"
filter = "sbr_include.nss"
filter = "shd_inc_metashd.nss"
filter = "shd_inc_myst.nss"
filter = "shd_inc_mystknwn.nss"
filter = "shd_inc_shdfunc.nss"
filter = "shd_mysthook.nss"
filter = "shd_myst_const.nss"
filter = "spinc_bolt.nss"
filter = "spinc_burst.nss"
filter = "spinc_cone.nss"
filter = "spinc_dimdoor.nss"
filter = "spinc_engimm.nss"
filter = "spinc_fdisk.nss"
filter = "spinc_greenfire.nss"
filter = "spinc_lessorb.nss"
filter = "spinc_maze.nss"
filter = "spinc_necro_cyst.nss"
filter = "spinc_orb.nss"
filter = "spinc_remeffct.nss"
filter = "spinc_telecircle.nss"
filter = "spinc_teleport.nss"
filter = "spinc_trans.nss"
filter = "tob_inc_martlore.nss"
filter = "tob_inc_move.nss"
filter = "tob_inc_moveknwn.nss"
filter = "tob_inc_recovery.nss"
filter = "tob_inc_tobfunc.nss"
filter = "tob_movehook.nss"
filter = "tob_move_const.nss"
filter = "true_inc_metautr.nss"
filter = "true_inc_truespk.nss"
filter = "true_inc_trufunc.nss"
filter = "true_inc_truknwn.nss"
filter = "true_inc_utter.nss"
filter = "true_utterhook.nss"
filter = "true_utter_const.nss"
filter = "utl_i_sqluuid.nss"
filter = "x0_i0_transport.nss"
filter = "x2_inc_cutscenep.nss"
filter = "x2_inc_spellhook.nss"
filter = "x3_inc_horse.nss"
filter = "prc_inc_string.nss"
filter = "prc_nui_sc_inc.nss"
filter = "prc_nui_scd_inc.nss"
filter = "prc_nui_consts.nss"
filter = "nw_inc_nui"
filter = "xchst_inc.nss"
[target.rules] [target.rules]
"*" = "src/hakpak/HAKNAME/$ext" "*" = "src/hakpak/sks01_prc8_top/$ext"

View File

@ -0,0 +1,90 @@
2DA V2.0
Description Resource Stinger1 Stinger2 Stinger3 DisplayName
0 61901 **** **** **** **** ****
1 61842 mus_ruralday1 **** **** **** ****
2 61843 mus_ruralday2 **** **** **** ****
3 61844 mus_ruralnite **** **** **** ****
4 61845 mus_forestday1 **** **** **** ****
5 61846 mus_forestday2 **** **** **** ****
6 61847 mus_forestnite **** **** **** ****
7 61848 mus_gendungeon1 **** **** **** ****
8 61849 mus_sewer **** **** **** ****
9 61850 mus_mines1 **** **** **** ****
10 61851 mus_mines2 **** **** **** ****
11 61852 mus_crypt1 **** **** **** ****
12 61853 mus_crypt2 **** **** **** ****
13 61854 mus_evildungeon1 **** **** **** ****
14 61855 mus_evildungeon2 **** **** **** ****
15 61856 mus_cityslumday **** **** **** ****
16 61857 mus_cityslumnite **** **** **** ****
17 61858 mus_citydockday **** **** **** ****
18 61859 mus_citydocknite **** **** **** ****
19 61860 mus_citywealthy **** **** **** ****
20 61861 mus_citymarket **** **** **** ****
21 61862 mus_citynite **** **** **** ****
22 61863 mus_tavern1 **** **** **** ****
23 61864 mus_tavern2 **** **** **** ****
24 61865 mus_tavern3 **** **** **** ****
25 61866 mus_richhouse **** **** **** ****
26 61867 mus_store **** **** **** ****
27 61868 mus_templegood **** **** **** ****
28 61869 mus_templeevil **** **** **** ****
29 61870 mus_theme_nwn **** **** **** ****
30 **** mus_honorbound **** **** **** CH1HonorBound
31 **** mus_strangeland **** **** **** CH2StrangeLand
32 61873 mus_theme_chap3 **** **** **** ****
33 61874 mus_theme_chap4 **** **** **** ****
34 61875 mus_bat_rural1 mus_sbat_rural1 **** **** ****
35 61876 mus_bat_forest1 mus_sbat_forest1 **** **** ****
36 61877 mus_bat_forest2 mus_sbat_forest2 **** **** ****
37 61878 mus_bat_dung1 mus_sbat_dung1 **** **** ****
38 61879 mus_bat_dung2 mus_sbat_dung2 **** **** ****
39 61880 mus_bat_dung3 mus_sbat_dung3 **** **** ****
40 61881 mus_bat_city1 mus_sbat_city1 **** **** ****
41 61882 mus_bat_city2 mus_sbat_city2 **** **** ****
42 61883 mus_bat_city3 mus_sbat_city3 **** **** ****
43 61884 mus_bat_citboss mus_sbat_citboss **** **** ****
44 61885 mus_bat_forboss mus_sbat_forboss **** **** ****
45 61886 mus_bat_lizboss mus_sbat_lizboss **** **** ****
46 61887 mus_bat_dragon mus_sbat_dragon **** **** ****
47 61888 mus_bat_aribeth mus_sbat_aribeth **** **** ****
48 61889 mus_bat_endboss mus_sbat_endboss **** **** ****
49 66833 mus_templegood2 **** **** **** ****
50 66883 mus_castle **** **** **** ****
51 66878 mus_theme_aribgd **** **** **** ****
52 66879 mus_theme_aribev **** **** **** ****
53 66880 mus_theme_argend **** **** **** ****
54 66881 mus_theme_maugrm **** **** **** ****
55 66882 mus_theme_morag **** **** **** ****
56 67545 mus_tavern4 **** **** **** ****
57 8807 mus_bat_x0desert **** **** **** ****
58 8806 mus_x0desertday **** **** **** ****
59 8805 mus_x0winterday **** **** **** ****
60 52827 mus_bat_x0winter **** **** **** ****
61 40050 mus_x0desertngt **** **** **** ****
62 86656 mus_x2theme **** **** **** ****
63 86657 mus_x2waterdeep **** **** **** ****
64 86658 mus_x2undermtn **** **** **** ****
65 86659 mus_x2rebelcamp **** **** **** ****
66 86660 mus_x2fireplane **** **** **** ****
67 86661 mus_x2queen **** **** **** ****
68 86662 mus_x2frozenhell **** **** **** ****
69 86663 mus_x2draco **** **** **** ****
70 86664 mus_bat_x2small mus_sbat_x2small **** **** ****
71 86665 mus_bat_x2med mus_sbat_x2med **** **** ****
72 86666 mus_bat_x2large mus_sbat_x2large **** **** ****
73 **** mus_bat_assault **** **** **** Assault
74 86668 mus_bat_x2boss1 mus_sbat_x2boss1 **** **** ****
75 86669 mus_bat_x2boss2 mus_sbat_x2boss2 **** **** ****
76 110653 mus_dd_kingmaker **** **** **** ****
77 110654 mus_dd_shadowgua **** **** **** ****
78 110655 mus_dd_witchwake **** **** **** ****
79 110725 mus_dd_islands **** **** **** ****
80 110726 mus_dd_pirates **** **** **** ****
81 **** **** **** **** **** ****
82 **** **** **** **** **** ****
83 **** **** **** **** **** ****
84 **** **** **** **** **** ****
85 61871 mus_theme_chap1 **** **** **** ****
86 61872 mus_theme_chap2 **** **** **** ****

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 MiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,240 @@
/*69_leadership
Leadership Library Functions
Created by: 69MEH69
Created on: Sep2004
*/
//void main(){}
//Level of PC when Leadership begins
const int LEADERSHIP_LEVEL = 6;
//Returns Loyalty modifier
int GetHenchLoyalty(object oHench, object oPC);
//Returns TRUE if PC has Leadership (must be level 6 or higher)
int GetHasLeadership(object oPC);
//Returns Leadership Score
int GetLeadershipScore(object oPC);
//Sets maximum number of henchmen based on Leadership
void SetMaxHenchmen69(object oPC);
//Returns maximum number of henchmen based on Leadership
int GetMaxHenchmen69(object oPC);
int GetHenchLoyalty(object oHench, object oPC)
{
int TEST_MODE = GetLocalInt(GetModule(), "TEST_MODE");
int nCharisma = GetAbilityModifier(ABILITY_CHARISMA, oPC);
//Initial roll + charisma
int nLoyalty = d6(3) + nCharisma;
string sLoyalty, sHenchdeath;
//Test
if(TEST_MODE == 1)
{
sLoyalty = IntToString(nLoyalty);
SendMessageToPC(oPC, "Initial nLoyalty = " + sLoyalty);
}
int nHenchAlign = GetAlignmentGoodEvil(oHench);
int nPCAlign = GetAlignmentGoodEvil(oPC);
int nHenchDeath = GetLocalInt(oPC, "Hench_Death");
//Adjustment for alignments
if(nHenchAlign == nPCAlign)
{
++nLoyalty;
}
else
{
--nLoyalty;
}
//Test
if(TEST_MODE == 1)
{
sLoyalty = IntToString(nLoyalty);
SendMessageToPC(oPC, "nLoyalty - Alignment = " + sLoyalty);
}
//Adjustment for number of dead henchmen
nLoyalty = nLoyalty - nHenchDeath;
//Test
if(TEST_MODE == 1)
{
sHenchdeath =IntToString(nHenchDeath);
sLoyalty = IntToString(nLoyalty);
SendMessageToPC(oPC, "Henchmen deaths = " + sHenchdeath);
SendMessageToPC(oPC, "nLoyalty - nHenchDeath = " + sLoyalty);
SendMessageToPC(oPC, "Loyalty score = " + sLoyalty);
}
return nLoyalty;
}
int GetHasLeadership(object oPC)
{
int TEST_MODE = GetLocalInt(GetModule(), "TEST_MODE");
int nLeadership = GetHitDice(oPC);
if(nLeadership >= LEADERSHIP_LEVEL)
{
//Test
if(TEST_MODE == 1)
{
SendMessageToPC(oPC, "Leadership is True");
}
return TRUE;
}
else
{
//Test
if(TEST_MODE == 1)
{
SendMessageToPC(oPC, "Leadership is False");
}
return FALSE;
}
}
int GetLeadershipScore(object oPC)
{
int TEST_MODE = GetLocalInt(GetModule(), "TEST_MODE");
int nPCLevel = GetHitDice(oPC);
int nCharisma = GetAbilityModifier(ABILITY_CHARISMA, oPC);
int nPersuade = GetSkillRank(SKILL_PERSUADE, oPC);
int nLeadershipScore = nPCLevel + nCharisma;
//Test
if(TEST_MODE == 1)
{
string sCharisma = IntToString(nCharisma);
SendMessageToPC(oPC, "Charisma score = " + sCharisma);
string sPersuade = IntToString(nPersuade);
SendMessageToPC(oPC, "Persuade score = " + sPersuade);
string sLeadershipScore = IntToString(nLeadershipScore);
SendMessageToPC(oPC, "Leadership score = " + sLeadershipScore);
}
return nLeadershipScore;
}
void SetMaxHenchmen69(object oPC)
{
int nLeadershipScore = GetLeadershipScore(oPC);
//Primary Code
if(GetHasLeadership(oPC) == FALSE)
{
SetLocalInt(oPC, "MaxHenchmen", 0);
}
else if(nLeadershipScore >= 25)
{
SetLocalInt(oPC, "MaxHenchmen", 10);
}
else if(nLeadershipScore >= 20)
{
SetLocalInt(oPC, "MaxHenchmen", 5);
}
else if(nLeadershipScore >= 15)
{
SetLocalInt(oPC, "MaxHenchmen", 4);
}
else if(nLeadershipScore >= 10)
{
SetLocalInt(oPC, "MaxHenchmen", 3);
}
else if(nLeadershipScore >= 8)
{
SetLocalInt(oPC, "MaxHenchmen", 2);
}
else if(nLeadershipScore >= 2)
{
SetLocalInt(oPC, "MaxHenchmen", 1);
}
else
{
SetLocalInt(oPC, "MaxHenchmen", 0);
}
//End Primary Code
//Secondary Code
//Uncomment following code to use this form
//Comment out the Primary Code
/*
if(GetHasLeadership(oPC) == FALSE)
{
SetLocalInt(oPC, "MaxHenchmen", 0);
return;
}
switch(nLeadershipScore)
{
case 0: case -1: case -2: case -3:
SetLocalInt(oPC, "MaxHenchmen", 0);
break;
case 1:
SetLocalInt(oPC, "MaxHenchmen", 1);
break;
case 2:
SetLocalInt(oPC, "MaxHenchmen", 1);
break;
case 3:
SetLocalInt(oPC, "MaxHenchmen", 1);
break;
case 4:
SetLocalInt(oPC, "MaxHenchmen", 2);
break;
case 5:
SetLocalInt(oPC, "MaxHenchmen", 2);
break;
case 6:
SetLocalInt(oPC, "MaxHenchmen", 2);
break;
case 7:
SetLocalInt(oPC, "MaxHenchmen", 3);
break;
case 8:
SetLocalInt(oPC, "MaxHenchmen", 3);
break;
case 9:
SetLocalInt(oPC, "MaxHenchmen", 3);
break;
case 10:
SetLocalInt(oPC, "MaxHenchmen", 4);
break;
case 11:
SetLocalInt(oPC, "MaxHenchmen", 4);
break;
case 12:
SetLocalInt(oPC, "MaxHenchmen", 4);
break;
case 13: case 14: case 15:
SetLocalInt(oPC, "MaxHenchmen", 5);
break;
case 16: case 17: case 18:
SetLocalInt(oPC, "MaxHenchmen", 6);
break;
default:
SetLocalInt(oPC, "MaxHenchmen", 7);
break;
}*/
//End Secondary Code
}
int GetMaxHenchmen69(object oPC)
{
int TEST_MODE = GetLocalInt(GetModule(), "TEST_MODE");
int nMaxHenchmen = GetLocalInt(oPC, "MaxHenchmen");
//Test
if(TEST_MODE == 1)
{
string sMaxHenchmen = IntToString(nMaxHenchmen);
SendMessageToPC(oPC, "Maximum allowable henchmen = " + sMaxHenchmen);
}
return nMaxHenchmen;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,747 @@
//void main(){}
//::///////////////////////////////////////////////
//:: Natural Bioware Database Extension v1.0
//:: nbde_inc
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By: Knat
//:: Created On: 8/2004
//:://////////////////////////////////////////////
/*
Natural Bioware Database Extension v1.0
"Andale, Andale! EEEE-ha....!"
-----------------------------------------------------------------------------
--- What is NBDE ?
-----------------------------------------------------------------------------
NBDE is basically a wrapper for the standard bioware database system,
eliminating most of its restrictions. But even more important, it significantly
boosts both reading and writing speed.
It will make your db scripts more secure and always keeps your database files
in the best possible shape. It furthermore reduces the amount of overhead in
your database and keeps it as slim as possible.
there is no need to periodically use a pack utility, which further
reduces administrative tasks...
and this all gets achieved with the use of this simple script. I recommend any
scripter to check this out if he plans to use biowares onboard database
functionality. It should also be very easy to convert already existing scripts.
-----------------------------------------------------------------------------
--- Installation
-----------------------------------------------------------------------------
Simply import nbde.erf and you are done.
It includes the following stuff:
Scripts:
name: nbde_inc
main include script...
Areas:
name: _NBDE
special area. this is a 2x2 microset area holding the database vault container.
you can delete this area and move the container to another place if you want.
Items:
Custom > Special > Custom 4
name: Database
special database item with the resref "nbde_database"
don't touch this item...
-----------------------------------------------------------------------------
--- Eliminated Restrictions ?
-----------------------------------------------------------------------------
Biowares database system mimics the interface of Local Variables.
Instead of SetLocalInt() you use SetCampaignInt(), GetLocalInt() turns into
GetCampaignInt(). This makes it very easy to use, even for novice scripters.
But the normal bioware database does not consequently implement this approach.
Several stumbling blocks, slight differences to normal Set-/GetLocal functions,
may lead to severe functional problems and hard to track bugs if you try to
achieve a bit more complex goals...
>>> 32-Char sVarName Limitation:
--------------------------------
the sVarName parameter in the original functions only accepts strings with a
maximum length of 32 chars. it will simply cut the string if it exceeds this
limit...
example:
SetCampaignInt("MYDB", "PREFIX" + GetTag(oArea), 100);
The second parameter is the sVarName one, with the 32 char limit. The above
statement is a bit risky, because GetTag(oArea) could return a string with a
maximum length of 32. "PREFIX" has a length of 6 chars, so any area with a
tag of length >26 could lead to unintended sVarNames.
Same for this example:
SetCampaignInt("MYDB", GetName(oPC) + GetPCPlayerName(oPC), 100);
same problem. GetName() alone may return a string with a length >32, which
could again lead to a problematic sVarName.
NBDE completely eliminates the 32-char sVarName limitation and enables the
scripter to use the full scope of dynamically concatenated sVarNames,
without the need of hashing systems or other workarounds, which generally
consume a bit of extra cpu time...
>>> UNIQUE sVarName Limitation:
-------------------------------
the sVarName parameter in the original functions MUST be unique across the
entire database, regardless of the variable type.
example:
SetCampaignInt("MYDB", "TEST", 10);
SetCampaignString("MYDB", "TEST", "ABCD");
the second line will OVERWRITE the former integer variable "TEST" with a string.
This means a GetCampaignInt("MYDB", "TEST") returns 0
using NBDE eliminates this limitation.
It works now similar to LocalVariables (the intended goal)
NBDE conversion of the above example:
NBDE_SetCampaignInt("MYDB", "TEST", 10);
NBDE_SetCampaignString("MYDB", "TEST", "ABCD");
second line will not overwrite the integer variable
NBDE_GetCampaignInt("MYDB", "TEST") returns the correct 10
NBDE_GetCampaignString("MYDB", "TEST") returns "ABCD"
The original function set contains only one delete command, called
DeleteCampaignVariable(), because of the unique nature of sVarNames.
NBDE contains one delete command for each variable type, to account for the
possible non uniqueness:
NBDE_DeleteCampaignInt()
NBDE_DeleteCampaignFloat()
NBDE_DeleteCampaignString()
NBDE_DeleteCampaignVector()
NBDE_DeleteCampaignLocation()
this again now works similar to the LocalVariables interface, which also
gives you a delete command for each variable type:
aka DeleteLoaclInt(), DeleteLocalFloat(), DeleteLocalString(),
DeleteLocalVector(), DeleteLocalLocation()
>>> Broken Locations:
---------------------
the original SetCampaignLocation/GetCampaignLocation functions are not very
reliable, because they are using the areas object-id for reference, which
is a runtime generated ID. stored locations in the database can get invalid
if you change the area layout in the toolset (e.g. deleting old areas, etc.)
nbde location functions are 100% reliable, as long as you use unique TAGs for
your areas. I repeat, you need to use UNIQUE TAGS for your areas...
-----------------------------------------------------------------------------
--- No need to pack the database
-----------------------------------------------------------------------------
NWN's database files grow very large, very fast, because deleted entries get
only "flagged" as deleted. but they still reside in the dabase file physically.
to stop this evergrowing database, you usually call an external "pack"
utility which reorganizes the database files (deletion of flagged entries,
index re-ordering, etc.)
unfortunately, the only working pack utility is the one you find in the
/utils directory, called DataPack.exe . But some people reported problems
on large database files... (i never had problems with this tool, though)
the good news is, you don't need to touch this utility ever, while using
this extension. NBDE will automatically keep all your database files as
compact/small as possible.
no external maintenance needed...
NBDE_Delete commands immediately shrink your database in size (physically
deleted records) after a flushing command (read more about that in a minute).
attention:
there is a known problem in the linux version:
The DestroyCampaignDatabase command doesnt always work in linux. i think
this relates to the different file systems used.
you should be ok using the following rules for your database
names (sCampaignName parameter):
- max length 16 chars
- only use alphanumeric chars and underscore
- NO space
-----------------------------------------------------------------------------
--- Usage
-----------------------------------------------------------------------------
first, include nbde_inc to all scripts using this extension:
#include "nbde_inc"
You basically use it the same way you would use the original
database. just add the NBDE_ prefix infront of the function.
original example:
int n = GetCampaignInt("MYDB", "MYVAR");
nbde conversion:
#include "nbde_inc"
int n = NBDE_GetCampaignInt("MYDB", "MYVAR");
Important differences:
Database Flushing:
------------------
writing to the database will not issue a physical write directly.
You need to "Flush" a database in order to physically write the contents of
a complete database to your HD. this sounds slow, but its not, because of
the large overhead of standard SetCampaign calls...
Writing out a single integer via SetCampaignInt takes roughly
100ms (0.1 seconds), writing out an object with 1000 integers via
SetCampaignObject takes roughly 150ms. that's the whole
magic behind the system. it basically just consolidates your writes..
original example:
SetCampaignInt("MYDB", "MYVAR1", 10);
SetCampaignInt("MYDB", "MYVAR2", 20);
SetCampaignInt("MYDB", "MYVAR3", 30);
SetCampaignInt("MYDB", "MYVAR4", 40);
SetCampaignInt("MYDB", "MYVAR5", 50);
nbde conversion:
NBDE_SetCampaignInt("MYDB", "MYVAR1", 10);
NBDE_SetCampaignInt("MYDB", "MYVAR2", 20);
NBDE_SetCampaignInt("MYDB", "MYVAR3", 30);
NBDE_SetCampaignInt("MYDB", "MYVAR4", 40);
NBDE_SetCampaignInt("MYDB", "MYVAR5", 50);
NBDE_FlushCampaignDatabase("MYDB");
the original example takes roughly half a second (500ms),
the converted example only 100ms.
you can gain a lot of speed and do things impossible with the original
database using the right flushing scheme. you can flush critical data asap
but you can get away flushing not so critical stuff only once every few
minutes, or during onClientLeave, or once an Area is out of players, and so on...
keep in mind: you can loose data if the server crashes before
you flushed your database.
delete function:
----------------
the original version only got one delete function, DeleteCampaignVariable.
That's because of the unique nature of sVarNames...
NBDE eliminates this restriction and therefore exposes one delete
function for each data-type.
original example:
DeleteCampaignVariable("MYDB", "MYVAR");
you need to know the datatype of "MYVAR" in order to correctly convert this
line to NBDE. lets assume it's an integer...
nbde conversion:
NBDE_DeleteCampaignInt("MYDB", "MYVAR");
Unloading a Database:
---------------------
nbde databases are kept in memory. NBDE_UnloadCampaignDatabase() unloads
the database with the name sCampaignName from memory.
useful to unload databases you don't need often. unloading/reloading is quite
fast, so don't hesitate to use this regulary...
*/
// database item name, used as sVarName parameter in Store-/RetrieveCampaignObject
const string NBDE_DATABASE_ITEM_VARNAME = "+++_DATABASE_ITEM_+++";
// database item resref, needed for auto-creation
const string NBDE_DATABASE_ITEM_RESREF = "nbde_database";
// database index prefix
// used to index a database via Get/SetLocalObject
const string NBDE_INDEX_PREFIX = "NBDE_DATABASE_";
// database vault tag
// this vault is usually a container
const string NBDE_VAULT_TAG = "NBDE_VAULT";
// prefixes used to store locations/vectors as strings
// this should eliminate collisions with normal strings
const string NBDE_LOC_PREFIX = "¥Æ¥";
const string NBDE_VEC_PREFIX = "ø£ø";
// This stores an int out to the specified campaign database
// The database name IS case sensitive and it must be the same for both set and get functions.
// If you want a variable to pertain to a specific player in the game, provide a player object.
//
// Improvements to original bioware function:
// Vastly improved writing speed...
// There is no limit on the length of sVarname (original function is limited to 32 chars)
// sVarname must NOT be unique. you can use the same sVarname with a different data-type
void NBDE_SetCampaignInt(string sCampaignName, string sVarname, int nInt, object oPlayer = OBJECT_INVALID);
// This stores a float out to the specified campaign database
// The database name IS case sensitive and it must be the same for both set and get functions.
// If you want a variable to pertain to a specific player in the game, provide a player object.
//
// Improvements to original bioware function:
// Vastly improved writing speed...
// There is no limit on the length of sVarname (original function is limited to 32 chars)
// sVarname must NOT be unique. you can use the same sVarname with a different data-type
void NBDE_SetCampaignFloat(string sCampaignName, string sVarname, float flFloat, object oPlayer = OBJECT_INVALID);
// This stores a string out to the specified campaign database
// The database name IS case sensitive and it must be the same for both set and get functions.
// If you want a variable to pertain to a specific player in the game, provide a player object.
//
// Improvements to original bioware function:
// Vastly improved writing speed...
// There is no limit on the length of sVarname (original function is limited to 32 chars)
// sVarname must NOT be unique. you can use the same sVarname with a different data-type
void NBDE_SetCampaignString(string sCampaignName, string sVarname, string sString, object oPlayer = OBJECT_INVALID);
// This stores a location out to the specified campaign database
// The database name IS case sensitive and it must be the same for both set and get functions.
// If you want a variable to pertain to a specific player in the game, provide a player object.
//
// Improvements to original bioware function:
// Vastly improved writing speed...
// There is no limit on the length of sVarname (original function is limited to 32 chars)
// sVarname must NOT be unique. you can use the same sVarname with a different data-type
//
// Original function is not very reliable, because it is using the areas object-id, which is
// a runtime generated ID. Stored locations may turn invalid in case you change the area layout in the toolset.
// (e.g. deleting old areas)
//
// This function is 100% reliable, as long as you use unique TAGs for your areas
void NBDE_SetCampaignLocation(string sCampaignName, string sVarname, location locLocation, object oPlayer = OBJECT_SELF);
// This stores a vector out to the specified campaign database
// The database name IS case sensitive and it must be the same for both set and get functions.
// If you want a variable to pertain to a specific player in the game, provide a player object.
//
// Improvements to original bioware function:
// Vastly improved writing speed...
// There is no limit on the length of sVarname (original function is limited to 32 chars)
// sVarname must NOT be unique. you can use the same sVarname with a different data-type
void NBDE_SetCampaignVector(string sCampaignName, string sVarname, vector vVector, object oPlayer = OBJECT_SELF);
// This will read an int from the specified campaign database
// The database name IS case sensitive and it must be the same for both set and get functions.
// If you want a variable to pertain to a specific player in the game, provide a player object.
//
// Improvements to original bioware function:
// Improved reading speed...
// There is no limit on the length of sVarname (original function is limited to 32 chars)
// sVarname must NOT be unique. you can use the same sVarname with a different data-type
int NBDE_GetCampaignInt(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID);
// This will read a float from the specified campaign database
// The database name IS case sensitive and it must be the same for both set and get functions.
// If you want a variable to pertain to a specific player in the game, provide a player object.
//
// Improvements to original bioware function:
// Improved reading speed...
// There is no limit on the length of sVarname (original function is limited to 32 chars)
// sVarname must NOT be unique. you can use the same sVarname with a different data-type
float NBDE_GetCampaignFloat(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID);
// This will read a string from the specified campaign database
// The database name IS case sensitive and it must be the same for both set and get functions.
// If you want a variable to pertain to a specific player in the game, provide a player object.
//
// Improvements to original bioware function:
// Improved reading speed...
// There is no limit on the length of sVarname (original function is limited to 32 chars)
// sVarname must NOT be unique. you can use the same sVarname with a different data-type
string NBDE_GetCampaignString(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID);
// This will read a location from the specified campaign database
// The database name IS case sensitive and it must be the same for both set and get functions.
// If you want a variable to pertain to a specific player in the game, provide a player object.
//
// Improvements to original bioware function:
// Improved reading speed...
// There is no limit on the length of sVarname (original function is limited to 32 chars)
// sVarname must NOT be unique. you can use the same sVarname with a different data-type
//
// Original function is not very reliable, because it is using the areas object-id, which is
// a runtime generated ID. Stored locations may turn invalid in case you change the area layout in the toolset.
// (e.g. deleting old areas)
//
// This function is 100% reliable, as long as you use unique TAGs for your areas
location NBDE_GetCampaignLocation(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID);
// This will read a vector from the specified campaign database
// The database name IS case sensitive and it must be the same for both set and get functions.
// If you want a variable to pertain to a specific player in the game, provide a player object.
//
// Improvements to original bioware function:
// Improved reading speed...
// There is no limit on the length of sVarname (original function is limited to 32 chars)
// sVarname must NOT be unique. you can use the same sVarname with a different data-type
vector NBDE_GetCampaignVector(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID);
// this will remove an integer from the specified campaign database
//
// Improvements to original bioware function:
// This will physically delete the variable from the database, not only flagging it
// Database will shrink in size
// No need to pack your database ever
void NBDE_DeleteCampaignInt(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID);
// this will remove a float from the specified campaign database
//
// Improvements to original bioware function:
// This will physically delete the variable from the database, not only flagging it
// Database will shrink in size
// No need to pack your database ever
void NBDE_DeleteCampaignFloat(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID);
// This will remove a string from the specified campaign database
//
// Improvements to original bioware function:
// This will physically delete the variable from the database, not only flagging it
// Database will shrink in size
// No need to pack your database ever
void NBDE_DeleteCampaignString(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID);
// This will remove a location from the specified campaign database
//
// Improvements to original bioware function:
// This will physically delete the variable from the database, not only flagging it
// Database will shrink in size
// No need to pack your database ever
void NBDE_DeleteCampaignLocation(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID);
// This will remove a vector from the specified campaign database
//
// Improvements to original bioware function:
// This will physically delete the variable from the database, not only flagging it
// Database will shrink in size
// No need to pack your database ever
void NBDE_DeleteCampaignVector(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID);
// This will flush a database to disk with a SINGLE StoreCampaignObject() call
//
// Don't use this function in a rapid manner.
// Delay each call to this function by at least 1 second (using delaycommand)
// in order to eliminate possible spikes...
void NBDE_FlushCampaignDatabase(string sCampaignName);
// NBDE databases are kept in memory. this commands unloads
// the database with the name sCampaignName from memory.
//
// Useful to unload databases you don't need often.
// Unloading/reloading is quite fast, so don't hesitate to use
// this regulary...
//
// Reloading happens automatically, btw...
void NBDE_UnloadCampaignDatabase(string sCampaignName);
// --------------------------- IMPLEMENTATION ----------------------------
/* ----------------------------------------------------------------------- */
// everything not in here gets considered an illegal character
// - mixed up for additional security
const string HASH_INDEX = "#i!j$k%l{&M/n(o)p=q?r^¤Xs`Tu'v]AwBxCyDzE1F2-G3t;4I}5Y:J6_K7+Z[Lm9N\ l0kOjPhQ,gRfSeHdU8cVbWa.";
const int HASH_PRIME = 3021377;
// simple hash
// returns -1 if string contains illegal character
int NBDE_Hash(string sData)
{
int nLen = GetStringLength(sData);
int i, nHash, nChar;
for(i=0;i<nLen;i++)
{
nChar = FindSubString(HASH_INDEX, GetSubString(sData,i,1));
if(nChar == -1) return -1;
nHash = ((nHash<<5) ^ (nHash>>27)) ^ nChar;
}
return nHash % HASH_PRIME;
}
// serialize location to padded string
string NBDE_LocationToString(location lLoc)
{
// serialization garbage... more or less "redo if it screws" code
string sLoc = IntToString(FloatToInt(GetPositionFromLocation(lLoc).x*100));
sLoc = (GetStringLength(sLoc) < 5) ? sLoc + GetStringLeft(" ",5 - GetStringLength(sLoc)) : GetStringLeft(sLoc,5);
sLoc += IntToString(FloatToInt(GetPositionFromLocation(lLoc).y*100));
sLoc = (GetStringLength(sLoc) < 10) ? sLoc + GetStringLeft(" ",10 - GetStringLength(sLoc)) : GetStringLeft(sLoc,10);
sLoc += IntToString(FloatToInt(GetPositionFromLocation(lLoc).z*100));
sLoc = (GetStringLength(sLoc) < 15) ? sLoc + GetStringLeft(" ",15 - GetStringLength(sLoc)) : GetStringLeft(sLoc,15);
sLoc += IntToString(FloatToInt(GetFacingFromLocation(lLoc)*100));
sLoc = (GetStringLength(sLoc) < 20) ? sLoc + GetStringLeft(" ",20 - GetStringLength(sLoc)) : GetStringLeft(sLoc,20);
sLoc += GetTag(GetAreaFromLocation(lLoc));
sLoc = (GetStringLength(sLoc) < 52) ? sLoc + GetStringLeft(" ",52 - GetStringLength(sLoc)) : GetStringLeft(sLoc,52);
return sLoc;
}
// de-serialize string to location
location NBDE_StringToLocation(string sLoc)
{
// fast de-serialize code using padded strings
vector vVec;
// build vector
vVec.x = StringToFloat(GetStringLeft(sLoc,5)) / 100;
vVec.y = StringToFloat(GetSubString(sLoc,5,5)) / 100;
vVec.z = StringToFloat(GetSubString(sLoc,10,5)) / 100;;
int nPad = FindSubString(GetSubString(sLoc, 20,32)," ");
// build & return location
return Location(GetObjectByTag((nPad != -1) ? GetSubString(sLoc, 20,nPad) : GetSubString(sLoc, 20,32)), vVec, StringToFloat(GetSubString(sLoc,15,5)) / 100);
}
// serialize vector to padded string
string NBDE_VectorToString(vector vVec)
{
// serialization garbage... more or less "redo if it screws" code
string sVec = IntToString(FloatToInt(vVec.x*100));
sVec = (GetStringLength(sVec) < 5) ? sVec + GetStringLeft(" ",5 - GetStringLength(sVec)) : GetStringLeft(sVec,5);
sVec += IntToString(FloatToInt(vVec.y*100));
sVec = (GetStringLength(sVec) < 10) ? sVec + GetStringLeft(" ",10 - GetStringLength(sVec)) : GetStringLeft(sVec,10);
sVec += IntToString(FloatToInt(vVec.z*100));
sVec = (GetStringLength(sVec) < 15) ? sVec + GetStringLeft(" ",15 - GetStringLength(sVec)) : GetStringLeft(sVec,15);
return sVec;
}
vector NBDE_StringToVector(string sVec)
{
// fast de-serialize code using padded strings
vector vVec;
vVec.x = StringToFloat(GetStringLeft(sVec,5)) / 100;
vVec.y = StringToFloat(GetSubString(sVec,5,5)) / 100;
vVec.z = StringToFloat(GetSubString(sVec,10,5)) / 100;
return vVec;
}
// returns player key with hopefully safe delimiter
string NBDE_GetPlayerKey(object oPC)
{
return GetName(oPC)+"¤"+GetPCPlayerName(oPC);
}
// returns database object for the specified campaign database
//
// - auto-creates database object in case it doesn't exist
// - builds index for fast access
//
// you usually don't need to use this function directly...
object NBDE_GetCampaignDatabaseObject(string sCampaignName)
{
// get database item
object oDatabase = GetLocalObject(GetObjectByTag(NBDE_VAULT_TAG), NBDE_INDEX_PREFIX + sCampaignName);
// retrieve/create database if not indexed already
if(!GetIsObjectValid(oDatabase))
{
// get database vault object
// this container holds all database objects/items
object oVault = GetObjectByTag(NBDE_VAULT_TAG);
// check for valid vault
if(!GetIsObjectValid(oVault))
{
WriteTimestampedLogEntry("NBDE> Error: unable to locate '"+NBDE_VAULT_TAG+"' vault container object");
return OBJECT_INVALID;
}
// one time load
oDatabase = RetrieveCampaignObject(sCampaignName, NBDE_DATABASE_ITEM_VARNAME, GetLocation(oVault), oVault);
// not found ? create it
if(!GetIsObjectValid(oDatabase)) oDatabase = CreateItemOnObject(NBDE_DATABASE_ITEM_RESREF, oVault);
// check for valid database object
if(!GetIsObjectValid(oDatabase))
{
WriteTimestampedLogEntry("NBDE> Error: unable to create '"+sCampaignName+"' database object");
return OBJECT_INVALID;
}
// index item for fast access
SetLocalObject(oVault, NBDE_INDEX_PREFIX + sCampaignName, oDatabase);
}
return oDatabase;
}
// this will flush (aka write to disk) the specified campaign database in one big swoop
//
// don't use this function in a rapid manner.
// delay each subsequent call to this function by at least 1 second (using delaycommand)
// this way you completely eliminate cpu-spikes, no matter how many database
// you flush.
void NBDE_FlushCampaignDatabase(string sCampaignName)
{
// get database vault, it holds all database items
object oVault = GetObjectByTag(NBDE_VAULT_TAG);
if(GetIsObjectValid(oVault))
{
// get database item
object oDatabase = GetLocalObject(oVault, NBDE_INDEX_PREFIX + sCampaignName);
// store the whole database via one single StoreCampaignObject call
// all variables on the item get stored with the item
if(GetIsObjectValid(oDatabase))
{
// delete database on each flush to keep it compact and clean
DestroyCampaignDatabase(sCampaignName);
// store database
StoreCampaignObject(sCampaignName, NBDE_DATABASE_ITEM_VARNAME , oDatabase);
}
// database not loaded, no need to flush...
}
else // vault container missing
WriteTimestampedLogEntry("NBDE> Error: unable to locate '"+NBDE_VAULT_TAG+"' vault container object");
}
void NBDE_UnloadCampaignDatabase(string sCampaignName)
{
// get database vault, it holds all database items
object oVault = GetObjectByTag(NBDE_VAULT_TAG);
if(GetIsObjectValid(oVault))
{
// get database item
object oDatabase = GetLocalObject(oVault, NBDE_INDEX_PREFIX + sCampaignName);
if(GetIsObjectValid(oDatabase))
{
// delete index
DeleteLocalObject(oVault, NBDE_INDEX_PREFIX + sCampaignName);
// delete database object
DestroyObject(oDatabase);
}
// database not loaded, do nothing
}
else // vault container missing
WriteTimestampedLogEntry("NBDE> Error: unable to locate '"+NBDE_VAULT_TAG+"' vault container object");
}
void NBDE_SetCampaignInt(string sCampaignName, string sVarname, int nInt, object oPlayer = OBJECT_INVALID)
{
SetLocalInt(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname, nInt );
}
void NBDE_SetCampaignFloat(string sCampaignName, string sVarname, float fFloat, object oPlayer = OBJECT_INVALID)
{
SetLocalFloat(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname, fFloat);
}
void NBDE_SetCampaignString(string sCampaignName, string sVarname, string sString, object oPlayer = OBJECT_INVALID)
{
SetLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname, sString);
}
void NBDE_SetCampaignLocation(string sCampaignName, string sVarname, location locLocation, object oPlayer = OBJECT_SELF)
{
SetLocalString( NBDE_GetCampaignDatabaseObject(sCampaignName) ,
NBDE_LOC_PREFIX + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname ,
NBDE_LocationToString(locLocation) );
}
void NBDE_SetCampaignVector(string sCampaignName, string sVarname, vector vVector, object oPlayer = OBJECT_SELF)
{
SetLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
NBDE_VEC_PREFIX + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname ,
NBDE_VectorToString(vVector) );
}
int NBDE_GetCampaignInt(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID)
{
return GetLocalInt(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname );
}
float NBDE_GetCampaignFloat(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID)
{
return GetLocalFloat(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname );
}
string NBDE_GetCampaignString(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID)
{
return GetLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname );
}
location NBDE_GetCampaignLocation(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID)
{
return NBDE_StringToLocation( GetLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
NBDE_LOC_PREFIX + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname) );
}
vector NBDE_GetCampaignVector(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID)
{
return NBDE_StringToVector( GetLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName),
NBDE_VEC_PREFIX + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname) );
}
void NBDE_DeleteCampaignInt(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID)
{
DeleteLocalInt(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname);
}
void NBDE_DeleteCampaignFloat(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID)
{
DeleteLocalFloat(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname);
}
void NBDE_DeleteCampaignString(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID)
{
DeleteLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname);
}
void NBDE_DeleteCampaignLocation(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID)
{
DeleteLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
NBDE_LOC_PREFIX + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname);
}
void NBDE_DeleteCampaignVector(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID)
{
DeleteLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) ,
NBDE_VEC_PREFIX + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname);
}

View File

@ -0,0 +1,128 @@
//::///////////////////////////////////////////////
//:: [Charm Person or Animal]
//:: [nw_s0_charmani.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
/*
Charm Person
Enchantment (Charm) [Mind-Affecting]
Level: Brd 1, Sor/Wiz 1
Components: V, S
Casting Time: 1 standard action
Range: Close (25 ft. + 5 ft./2 levels)
Target: One humanoid creature
Duration: 1 hour/level
Saving Throw: Will negates
Spell Resistance: Yes
This charm makes a humanoid creature regard you as
its trusted friend and ally (treat the targets
attitude as friendly). If the creature is currently
being threatened or attacked by you or your allies,
however, it receives a +5 bonus on its saving throw.
The spell does not enable you to control the
charmed person as if it were an automaton, but it
perceives your words and actions in the most
favorable way. You can try to give the subject
orders, but you must win an opposed Charisma check
to convince it to do anything it wouldnt
ordinarily do. (Retries are not allowed.) An
affected creature never obeys suicidal or obviously
harmful orders, but it might be convinced that
something very dangerous is worth doing. Any act by
you or your apparent allies that threatens the
charmed person breaks the spell. You must speak the
persons language to communicate your commands, or
else be good at pantomiming.
*/
//:://////////////////////////////////////////////
//:: Will save or the target is dominated for 1 round
//:: per caster level.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 29, 2001
//:://////////////////////////////////////////////
//:: modified by mr_bumpkin Dec 4, 2003
#include "prc_inc_spells"
#include "prc_add_spell_dc"
#include "_prr_main"
void main()
{
if (!X2PreSpellCastCode()) return;
PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT);
//Declare major variables
object oCaster = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int CasterLvl = PRCGetCasterLevel(oCaster);
int nPenetr = CasterLvl + SPGetPenetr();
int nRacial = MyPRCGetRacialType(oTarget);
int nMetaMagic = PRCGetMetaMagicFeat();
int nDuration = 2 + CasterLvl/3;
nDuration = PRCGetScaledDuration(nDuration, oTarget);
//Meta magic duration check
if(nMetaMagic & METAMAGIC_EXTEND)
nDuration *= 2;
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
effect eCharm = EffectCharmed();
eCharm = PRCGetScaledEffect(eCharm, oTarget);
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Link the charm and duration visual effects
effect eLink = EffectLinkEffects(eMind, eCharm);
eLink = EffectLinkEffects(eLink, eDur);
// Get the string so we can check to see if the target is already charmed
string sCharmedVarName = "CHARMED_BY_" + GetName(OBJECT_SELF);
// Set the PRR Duration for friendlies
int nPRR_Duration = CasterLvl;
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire spell cast at event to fire on the target
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_CHARM_PERSON_OR_ANIMAL, FALSE));
//Make SR Check
if (!PRCDoResistSpell(oCaster, oTarget, nPenetr))
{
//Make sure the racial type of the target is applicable
if(PRCAmIAHumanoid(oTarget) ||
nRacial == RACIAL_TYPE_ANIMAL)
{
//Make Will Save
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, oCaster), SAVING_THROW_TYPE_MIND_SPELLS))
{
if(GetIsEnemy(oTarget))
{
//Apply impact and linked effects
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration), TRUE, SPELL_CHARM_PERSON_OR_ANIMAL, CasterLvl);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
else
{
//Only works if the creature is not already charmed (and not a pc)
if(GetLocalInt(oTarget, sCharmedVarName) != 1 && !GetIsPC(oTarget))
{
//Apply the linked effects and the VFX impact and adjust the PRR
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, 2.0);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
SendMessageToPC(OBJECT_SELF, "You have charmed " + GetName(oTarget) + " and the effect will last for " + IntToString(nPRR_Duration) + " hours.");
PRR_CHARM_AffectTarget(oTarget, OBJECT_SELF, nPRR_Duration);
}
else
{
SendMessageToPC(OBJECT_SELF, "You have already charmed " + GetName(oTarget));
}
}
}
}
}
}
PRCSetSchool();
}

View File

@ -0,0 +1,98 @@
//::///////////////////////////////////////////////
//:: [Charm Monster]
//:: [NW_S0_CharmMon.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Will save or the target is charmed for 1 round
//:: per 2 caster levels.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 29, 2001
//:://////////////////////////////////////////////
//:: Update Pass By: Preston W, On: July 25, 2001
//:: modified by mr_bumpkin Dec 4, 2003
#include "prc_inc_spells"
#include "prc_add_spell_dc"
#include "_prr_main"
void main()
{
if (!X2PreSpellCastCode()) return;
PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT);
//Declare major variables
object oCaster = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int CasterLvl = PRCGetCasterLevel(oCaster);
int nPenetr = CasterLvl + SPGetPenetr();
int nMetaMagic = PRCGetMetaMagicFeat();
int nDuration = 3 + CasterLvl/2;
nDuration = PRCGetScaledDuration(nDuration, oTarget);
// Get the string so we can check to see if the target is already charmed
string sCharmedVarName = "CHARMED_BY_" + GetName(OBJECT_SELF);
// Set the PRR Duration for friendlies
int nPRR_Duration = CasterLvl * 24;
//Metamagic extend check
if(nMetaMagic & METAMAGIC_EXTEND)
{
nDuration = nDuration * 2;
nPRR_Duration = CasterLvl * 24 * 2;
}
int nDidSucceedCharm = 0;
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
effect eCharm = EffectCharmed();
eCharm = PRCGetScaledEffect(eCharm, oTarget);
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Link effects
effect eLink = EffectLinkEffects(eMind, eCharm);
eLink = EffectLinkEffects(eLink, eDur);
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_CHARM_MONSTER, FALSE));
// Make SR Check
if (!PRCDoResistSpell(oCaster, oTarget, nPenetr))
{
// Make Will save vs Mind-Affecting
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, oCaster), SAVING_THROW_TYPE_MIND_SPELLS))
{
if(GetIsEnemy(oTarget))
{
//Apply impact and linked effect
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration), TRUE, SPELL_CHARM_MONSTER, CasterLvl);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
nDidSucceedCharm = 1;
}
else
{
//Only works if the creature is not already charmed (and not a pc)
if(GetLocalInt(oTarget, sCharmedVarName) != 1 && !GetIsPC(oTarget))
{
//Apply the linked effects and the VFX impact and adjust the PRR
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration), TRUE, SPELL_CHARM_MONSTER, CasterLvl);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
SendMessageToPC(OBJECT_SELF, "You have charmed " + GetName(oTarget) + " and the effect will last for " + IntToString(nPRR_Duration / 24) + " days.");
PRR_CHARM_AffectTarget(oTarget, OBJECT_SELF, nPRR_Duration);
nDidSucceedCharm = 1;
}
else
{
SendMessageToPC(OBJECT_SELF, "You have already charmed " + GetName(oTarget));
nDidSucceedCharm = 1;
} // End is target already charmed
} // End the moved is hostile check
}
}
}
PRCSetSchool();
}

View File

@ -0,0 +1,124 @@
//::///////////////////////////////////////////////
//:: [Charm Person]
//:: [NW_S0_CharmPer.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Will save or the target is charmed for 1 round
//:: per caster level.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 29, 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 5, 2001
//:: Last Updated By: Preston Watamaniuk, On: April 10, 2001
//:: VFX Pass By: Preston W, On: June 20, 2001
//:: modified by mr_bumpkin Dec 4, 2003
#include "prc_inc_spells"
#include "prc_add_spell_dc"
#include "_prr_main"
void main()
{
if (!X2PreSpellCastCode()) return;
PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT);
//Declare major variables
object oCaster = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nMetaMagic = PRCGetMetaMagicFeat();
int nCasterLvl = PRCGetCasterLevel(oCaster);
int nPenetr = nCasterLvl + SPGetPenetr();
int nDuration = 2 + nCasterLvl/3;
nDuration = PRCGetScaledDuration(nDuration, oTarget);
// Get the string so we can check to see if the target is already charmed
string sCharmedVarName = "CHARMED_BY_" + GetName(OBJECT_SELF);
// Set the PRR Duration for friendlies
int nPRR_Duration = nCasterLvl;
//Check for metamagic extend and adjust both durations
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration * 2;
nPRR_Duration = nCasterLvl * 2;
}
int nDidSucceedCharm = 0;
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
effect eCharm = EffectCharmed();
eCharm = PRCGetScaledEffect(eCharm, oTarget);
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Link persistant effects
effect eLink = EffectLinkEffects(eMind, eCharm);
eLink = EffectLinkEffects(eLink, eDur);
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_CHARM_PERSON, FALSE));
//Make SR Check
if (!PRCDoResistSpell(oCaster, oTarget, nPenetr))
{
//Verify that the Racial Type is humanoid
if(PRCAmIAHumanoid(oTarget))
{
//Make a Will Save check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, oCaster), SAVING_THROW_TYPE_MIND_SPELLS))
{
if(GetIsEnemy(oTarget))
{
//Apply impact and linked effects
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration), TRUE, SPELL_CHARM_PERSON, nCasterLvl);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
nDidSucceedCharm = 1;
}
else
{
//Only works if the creature is not already charmed (and not a pc)
if(GetLocalInt(oTarget, sCharmedVarName) != 1 && !GetIsPC(oTarget))
{
//Apply the linked effects and the VFX impact and adjust the PRR
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration), TRUE, SPELL_CHARM_PERSON, nCasterLvl);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
SendMessageToPC(OBJECT_SELF, "You have charmed " + GetName(oTarget) + " and the effect will last for " + IntToString(nPRR_Duration) + " hours.");
PRR_CHARM_AffectTarget(oTarget, OBJECT_SELF, nPRR_Duration);
nDidSucceedCharm = 1;
}
else
{
SendMessageToPC(OBJECT_SELF, "You have already charmed " + GetName(oTarget));
nDidSucceedCharm = 1;
}
}
}
else
{
if(!GetIsEnemy(oTarget))
{
AssignCommand(oTarget, SpeakString("If you are trying to cast some sort of spell on me, you had better stop."));
AdjustPersonalReaction(oTarget, OBJECT_SELF, -5);
}
}
}
}
// There is a penalty for failing a charm to keep it being used over and over
if(nDidSucceedCharm == 0)
{
if(!GetIsEnemy(oTarget) && GetIntelligence(oTarget) >= 6)
{
AssignCommand(oTarget, SpeakString("If you are trying to cast some sort of spell on me, you had better stop."));
AdjustPersonalReaction(oTarget, OBJECT_SELF, -5);
}
}
}
PRCSetSchool();
}

View File

@ -0,0 +1,222 @@
/** @file
nw_s0_cureinflict
Handles all the cure/inflict spells
By: Flaming_Sword
Created: Jun 13, 2006
Modified: Jun 30, 2006
Consolidation of multiple scripts
modified healing vfx for inflict spells
changed cure minor wounds to heal 1 hp
in line with SRD
added will save 1/2 damage for cure spells
added mass cure spells
added mass heal-like random delay for mass
cure spells (to look cool, delay can be
set to zero if desired)
*/
#include "69_hench_lib"
#include "prc_sp_func"
#include "prc_inc_function"
#include "prc_inc_sp_tch"
#include "prc_add_spell_dc"
//Implements the spell impact, put code here
// if called in many places, return TRUE if
// stored charges should be decreased
// eg. touch attack hits
//
// Variables passed may be changed if necessary
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nSpellID, int bIsCure)
{
int nMetaMagic = PRCGetMetaMagicFeat();
int bMass = IsMassCure(nSpellID) || IsMassInflict(nSpellID);
int nHealVFX;
int nEnergyType = bIsCure ? DAMAGE_TYPE_POSITIVE : DAMAGE_TYPE_NEGATIVE;
int nSpellLevel = StringToInt(lookup_spell_cleric_level(PRCGetSpellId()));
int nDice = bMass ? nSpellLevel - 4 : nSpellLevel; // The spells use a number of dice equivalent to spell level, mass versions 4 fewer
int bHeal;
switch(nDice) //nDice == 0 for cure/inflict minor wounds
{
case 0: nHealVFX = VFX_IMP_HEAD_HEAL; break;
case 1: nHealVFX = VFX_IMP_HEALING_S; break;
case 2: nHealVFX = VFX_IMP_HEALING_M; break;
case 3: nHealVFX = VFX_IMP_HEALING_L; break;
case 4: default: nHealVFX = VFX_IMP_HEALING_G; break;
}
// Extra points based on spell level, capped to caster level
int nExtraDamage = PRCMin(nSpellLevel * 5, nCasterLevel);
// Healing is more effective for players on low or normal difficulty
int nDifficultyCondition = (GetIsPC(oTarget) && (GetGameDifficulty() < GAME_DIFFICULTY_CORE_RULES)) && bIsCure;
// Mass spell AoE targeting
location lLoc;
if(bMass)
{
lLoc = PRCGetSpellTargetLocation();
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(bIsCure ? VFX_FNF_LOS_HOLY_20 : VFX_FNF_LOS_EVIL_20), lLoc);
}
// Targeting loop
float fDelay = 0.0;
int nHealed = 0;
int nMaxHealed = bMass ? nCasterLevel : 1;
int iAttackRoll = 1;
while(GetIsObjectValid(oTarget))
{
// Skip non-creatures. AoE targeting shouldn't get them anyway, but single target spells shouldn't affect non-creatures either
// Also skip constructs, since they are neither living nor undead. Technically, they would qualify for being healed by mass cures, but we assume that's just bad editing.
//Improved Fortification overrides Warforged's ability to be healed.
if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_CONSTRUCT && !GetIsWarforged(oTarget) || GetHasFeat(FEAT_IMPROVED_FORTIFICATION, oTarget))
{
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE);
continue;
}
//random delay like mass heal so it looks cool :P (can be set to zero if behavior is not desired)
if(bMass) fDelay = PRCGetRandomDelay();
// Roll damage / heal points
int iBlastFaith = BlastInfidelOrFaithHeal(oCaster, oTarget, nEnergyType, TRUE);
int iTombTainted = GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD;
int nHeal = 0;
if((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith || nDifficultyCondition)
{
nHeal = nDice * 8 + nExtraDamage;
if(nDifficultyCondition && ((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith))
nHeal += nExtraDamage; //extra damage on lower difficulties
}
else
nHeal = d8(nDice) + nExtraDamage;
// More feat effects
if((nMetaMagic & METAMAGIC_EMPOWER))
nHeal += (nHeal / 2);
if(GetHasFeat(FEAT_AUGMENT_HEALING, oCaster) && bIsCure)
nHeal += (nSpellLevel * 2);
// Cure Minor only does 1 - Fox
if(nDice == 0)
nHeal = 1;
//Healing Hands bonus even applies to Cure Minor - Fox
if(PRCGetLastSpellCastClass() == CLASS_TYPE_HEALER)
nHeal += GetAbilityModifier(ABILITY_CHARISMA, oCaster);
// Whether we are supposed to heal or hurt the target
bHeal = (!bIsCure && (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || iTombTainted)) || // Undead handling, non-cures heal them
(bIsCure && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD && !iTombTainted); // Undead handling, cures hurt them
if (GetLocalInt(oTarget, "AcererakHealing")) bHeal = TRUE;
// Healing, assume the caster never wants to heal hostiles and any targeting of such was a misclick
if(bHeal && !spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, oCaster))
{
//Warforged are only healed for half, none if they have Improved Fortification
if(GetIsWarforged(oTarget)) nHeal /= 2;
if(GetHasFeat(FEAT_IMPROVED_FORTIFICATION, oTarget)) nHeal = 0;
// Apply healing to the target
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectHeal(nHeal, oTarget), oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nHealVFX), oTarget));
// Let the AI know
SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID, FALSE));
// Increment the # of affected targets counter
nHealed++;
}
// Harming, assume the caster never wants to hurt non-hostiles and any targeting of such was a misclick
else if(!bHeal && spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, oCaster))
{
nHeal += SpellDamagePerDice(OBJECT_SELF, nDice);
// Roll touch attack if non-mass spell
iAttackRoll = bMass ? TRUE : PRCDoMeleeTouchAttack(oTarget);
if(iAttackRoll > 0)
{
// Let the AI know about hostile spell use
SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID));
// Roll SR
if(!PRCDoResistSpell(oCaster, oTarget, nCasterLevel + SPGetPenetr()))
{
// Save for half
if(PRCMySavingThrow(SAVING_THROW_WILL, oTarget,
PRCGetSaveDC(oTarget, oCaster, nSpellID),
bIsCure ? SAVING_THROW_TYPE_POSITIVE : SAVING_THROW_TYPE_NEGATIVE
)
)
{
nHeal /= 2;
// Mettle for total avoidance instead
if(GetHasMettle(oTarget, SAVING_THROW_WILL))
nHeal = 0;
}
// Apply effects
effect eDam = PRCEffectDamage(oTarget, nHeal, nEnergyType);
DelayCommand(fDelay + 1.0, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(bIsCure ? VFX_IMP_SUNSTRIKE : VFX_IMP_HARM), oTarget));
}
}
// Increment the # of affected targets counter
nHealed++;
}
// Terminate loop if target limit reached
if(nHealed >= nMaxHealed)
break;
// Otherwise get next target
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE);
}
return bMass ? TRUE : iAttackRoll; //return TRUE if spell charges should be decremented
}
void main()
{
if (!X2PreSpellCastCode()) return;
int nSpellID = PRCGetSpellId();
int bIsCure = IsMassCure(nSpellID) || IsCure(nSpellID); //whether it is a cure or inflict spell
int nSchool = bIsCure ? SPELL_SCHOOL_CONJURATION : SPELL_SCHOOL_NECROMANCY;
PRCSetSchool(nSchool);
object oCaster = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nCasterLevel = PRCGetCasterLevel(oCaster);
string sTag = GetTag(oTarget);
object oArea = GetArea(oTarget);
int nCHP = GetLocalInt(oArea, "nCHP" +sTag);
int nCure = d8(4);
// Check for holding charge
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
if(!nEvent) //normal cast
{ //can't hold the charge with mass cure/inflict spells
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget && IsTouchSpell(nSpellID))
{ //holding the charge, casting spell on self
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
return;
}
DoSpell(oCaster, oTarget, nCasterLevel, nSpellID, bIsCure);
}
else
{
if(nEvent & PRC_SPELL_EVENT_ATTACK)
{
if(DoSpell(oCaster, oTarget, nCasterLevel, nSpellID, bIsCure))
DecrementSpellCharges(oCaster);
}
}
if(GetIsHenchmanDying(oTarget) && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
SetLocalInt(oArea, "nCHP" +sTag, nCHP + nCure);
}
PRCSetSchool();
}

View File

@ -0,0 +1,168 @@
//::///////////////////////////////////////////////
//:: 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 "69_hench_lib"
#include "prc_inc_function"
#include "prc_inc_spells"
#include "prc_add_spell_dc"
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, nHP;
int nMetaMagic = PRCGetMetaMagicFeat();
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;
string sTag = GetTag(oTarget);
object oArea = GetArea(oTarget);
int nCHP = GetLocalInt(oArea, "nCHP" +sTag);
//Limit caster level
if (nCasterLvl > 20)
{
nCasterLvl = 20;
}
CasterLvl +=SPGetPenetr();
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation());
//Get first target in shape
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation());
while (GetIsObjectValid(oTarget))
{
fDelay = PRCGetRandomDelay();
//Check if racial type is undead
if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD
|| (GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD))
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HEALING_CIRCLE));
//Make SR check
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay))
{
int nDC = PRCGetSaveDC(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;
}
if ((nMetaMagic & METAMAGIC_EMPOWER))
{
nModify += (nModify/2); //Damage/Healing is +50%
}
nModify += SpellDamagePerDice(OBJECT_SELF, 1);
if (GetLevelByClass(CLASS_TYPE_HEALER, OBJECT_SELF))
nModify += GetAbilityModifier(ABILITY_CHARISMA, OBJECT_SELF);
//Make Fort save
if (PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (nDC), SAVING_THROW_TYPE_NONE, OBJECT_SELF, fDelay))
{
if (GetHasMettle(oTarget, SAVING_THROW_FORT))
// This script does nothing if it has Mettle, bail
nModify = 0;;
nModify /= 2;
}
//Set damage effect
eKill = PRCEffectDamage(oTarget, nModify, 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() + nCasterLvl;
//Enter Metamagic conditions
int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_POSITIVE, FALSE);
if ((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith)
{
nHP = 8 + nCasterLvl;//Damage is at max
}
if ((nMetaMagic & METAMAGIC_EMPOWER))
{
nHP = nHP + (nHP/2); //Damage/Healing is +50%
}
//Set healing effect
if (GetLevelByClass(CLASS_TYPE_HEALER, OBJECT_SELF))
nHP += GetAbilityModifier(ABILITY_CHARISMA, OBJECT_SELF);
eHeal = PRCEffectHeal(nHP, oTarget);
//Apply heal effect and VFX impact
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
if(GetIsHenchmanDying(oTarget))
{
SetLocalInt(oArea, "nCHP" +sTag, nCHP + nHP);
}
}
}
//Get next target in the shape
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation());
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

View File

@ -0,0 +1,202 @@
/*
nw_s0_healharm
Heal/Harm in the one script
By: Flaming_Sword
Created: Jun 14, 2006
Modified: Nov 21, 2006
Consolidation of heal/harm scripts
Mass Heal vfx on target looks like heal
added greater harm, mass harm
*/
#include "69_hench_lib"
#include "prc_sp_func"
#include "prc_inc_sp_tch"
#include "prc_inc_function"
#include "prc_add_spell_dc"
#include "inc_dispel"
//Implements the spell impact, put code here
// if called in many places, return TRUE if
// stored charges should be decreased
// eg. touch attack hits
//
// Variables passed may be changed if necessary
int DoSpell(object oCaster, object oTarget, int nSpellID)
{
int bIsHeal = IsHeal(nSpellID); //whether it is a heal or harm spell
int bMass = IsMassHealHarm(nSpellID);
int nCasterLevel = PRCGetCasterLevel(oCaster);
int nMetaMagic = PRCGetMetaMagicFeat();
int nHealVFX, nHurtVFX, nEnergyType, nDice, iBlastFaith, nHeal;
float fRadius;
string nSwitch;
int nCap = 150;
if(bIsHeal)
{
nHealVFX = VFX_IMP_HEALING_X;
nHurtVFX = VFX_IMP_SUNSTRIKE;
nEnergyType = DAMAGE_TYPE_POSITIVE;
nSwitch = PRC_BIOWARE_HEAL;
fRadius = RADIUS_SIZE_COLOSSAL;
if(nSpellID == SPELL_MASS_HEAL)
{
nSwitch = PRC_BIOWARE_MASS_HEAL;
nCap = 250;
}
}
else
{
nHealVFX = VFX_IMP_HEALING_G;
nHurtVFX = 246;
nEnergyType = DAMAGE_TYPE_NEGATIVE;
nSwitch = PRC_BIOWARE_HARM;
fRadius = RADIUS_SIZE_HUGE;
}
int iHeal;
int iAttackRoll = 1;
if((nSpellID == SPELL_MASS_HARM) || (nSpellID == SPELL_GREATER_HARM))
{
nDice = (nCasterLevel > 20) ? 20 : nCasterLevel;
nHeal = d12(nDice);
if((nMetaMagic & METAMAGIC_MAXIMIZE) || BlastInfidelOrFaithHeal(oCaster, oTarget, nEnergyType, TRUE))
nHeal = 12 * nDice; //in case higher level spell slots are available
}
else
{
nHeal = 10 * nCasterLevel;
}
if(nHeal > nCap && !GetPRCSwitch(nSwitch))
nHeal = nCap;
location lLoc;
if(bMass)
{
lLoc = (nSpellID == SPELL_MASS_HARM) ? GetLocation(oCaster) : PRCGetSpellTargetLocation();
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, fRadius, lLoc);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(bIsHeal ? VFX_FNF_LOS_HOLY_30 : VFX_FNF_LOS_EVIL_20), lLoc);
}
float fDelay = 0.0;
while(GetIsObjectValid(oTarget))
{
if(bMass) fDelay = PRCGetRandomDelay();
int iTombTainted = GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD;
iHeal = GetObjectType(oTarget) == OBJECT_TYPE_CREATURE &&
((!bIsHeal && (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || iTombTainted)) ||
(bIsHeal && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD && !iTombTainted));
if (GetLocalInt(oTarget, "AcererakHealing")) iHeal = TRUE;
if(iHeal && (spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, oCaster) || (GetIsDead(oTarget) && (GetCurrentHitPoints(oTarget) > -10))))
{
SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID, FALSE));
//Warforged are only healed for half, none if they have Improved Fortification
if(GetIsWarforged(oTarget)) nHeal /= 2;
if(GetHasFeat(FEAT_IMPROVED_FORTIFICATION, oTarget)) nHeal = 0;
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectHeal(nHeal, oTarget), oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nHealVFX), oTarget));
// Code for FB to remove damage that would be caused at end of Frenzy
SetLocalInt(oTarget, "PC_Damage", 0);
}
else if((GetObjectType(oTarget) != OBJECT_TYPE_CREATURE && !bIsHeal) ||
(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE && !iHeal))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oCaster)
{
SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID));
iAttackRoll = PRCDoMeleeTouchAttack(oTarget);
if(iAttackRoll)
{
if (!PRCDoResistSpell(oCaster, oTarget, nCasterLevel + SPGetPenetr()))
{
int nModify = d4();
iBlastFaith = BlastInfidelOrFaithHeal(oCaster, oTarget, nEnergyType, TRUE);
if((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith)
{
nModify = 1;
}
if((nSpellID == SPELL_MASS_HARM) || (nSpellID == SPELL_GREATER_HARM))
{
nHeal = d12(nDice);
if((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith)
nHeal = 12 * nDice;
nHeal += SpellDamagePerDice(oCaster, nDice);
}
else
{
nHeal = 10 * nCasterLevel;
}
if(nHeal > nCap && !GetPRCSwitch(nSwitch))
nHeal = nCap;
if(PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF)))
{
nHeal /= 2;
if (GetHasMettle(oTarget, SAVING_THROW_WILL)) // Ignores partial effects
nHeal = 0;
}
int nHP = GetCurrentHitPoints(oTarget);
if (nHeal > nHP - nModify)
nHeal = nHP - nModify;
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nHeal, nEnergyType), oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nHurtVFX), oTarget));
}
}
}
}
if(!bMass) break;
oTarget = MyNextObjectInShape(SHAPE_SPHERE, fRadius, lLoc);
}
//Spell Removal Check
SpellRemovalCheck(oCaster, oTarget);
return iAttackRoll; //return TRUE if spell charges should be decremented
}
void main()
{
if (DEBUG) DoDebug("nw_s0_healharm running "+IntToString(GetIsPC(OBJECT_SELF)));
int nSpellID = PRCGetSpellId();
PRCSetSchool(GetSpellSchool(nSpellID));
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
if(X2PreSpellCastCode())
{
object oCaster = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
string sTag = GetTag(oTarget);
object oArea = GetArea(oTarget);
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
if(!nEvent) //normal cast
{
if (DEBUG )DoDebug("nw_s0_healharm running normal casting");
if(IsTouchSpell(nSpellID) && GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
{ //holding the charge, casting spell on self
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
if (DEBUG) DoDebug("nw_s0_healharm running returning");
return;
}
if (DEBUG) DoDebug("nw_s0_healharm running DoSpell");
DoSpell(oCaster, oTarget, nSpellID);
}
else
{
if (DEBUG) DoDebug("nw_s0_healharm running else casting");
if(nEvent & PRC_SPELL_EVENT_ATTACK)
{
if(DoSpell(oCaster, oTarget, nSpellID))
DecrementSpellCharges(oCaster);
}
}
if(GetIsHenchmanDying(oTarget))
{
SetLocalInt(oArea, "nCHP" +sTag, 21);
}
}
PRCSetSchool();
}

View File

@ -0,0 +1,153 @@
//::///////////////////////////////////////////////
//:: [Mass Charm]
//:: [NW_S0_MsCharm.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
/*
The caster attempts to charm a group of individuals
who's HD can be no more than his level combined.
The spell starts checking the area and those that
fail a will save are charmed. The affected persons
are Charmed for 1 round per 2 caster levels.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 29, 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 10, 2001
//:: VFX Pass By: Preston W, On: June 22, 2001
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
#include "_prr_main"
#include "prc_inc_spells"
#include "prc_add_spell_dc"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ENCHANTMENT);
/*
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
object oTarget;
effect eCharm = EffectCharmed();
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_NORMAL_20);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eMind, eCharm);
eLink = EffectLinkEffects(eLink, eDur);
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
int nMetaMagic = PRCGetMetaMagicFeat();
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
int nCasterLevel = CasterLvl;
int nDuration = nCasterLevel;
int nHD = nCasterLevel;
int nCnt = 0;
int nRacial;
float fDelay;
int nAmount = nHD * 2;
// Get the string so we can check to see if the target is already charmed
string sCharmedVarName = "CHARMED_BY_" + GetName(OBJECT_SELF);
// Set the PRR Duration for friendlies
int nPRR_Duration = nCasterLevel * 24;
//Check for metamagic extend and adjust both durations
if (nMetaMagic & METAMAGIC_EXTEND)
{
nDuration = nCasterLevel;
nPRR_Duration = nCasterLevel * 24 * 2;
}
int nPenetr = CasterLvl + SPGetPenetr();
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation());
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation());
while (GetIsObjectValid(oTarget) && nAmount > 0)
{
if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF))
{
nRacial = MyPRCGetRacialType(oTarget);
fDelay = PRCGetRandomDelay();
//Check that the target is humanoid or animal
if ((nRacial == RACIAL_TYPE_DWARF) ||
(nRacial == RACIAL_TYPE_ELF) ||
(nRacial == RACIAL_TYPE_GNOME) ||
(nRacial == RACIAL_TYPE_HUMANOID_GOBLINOID) ||
(nRacial == RACIAL_TYPE_HALFLING) ||
(nRacial == RACIAL_TYPE_HUMAN) ||
(nRacial == RACIAL_TYPE_HALFELF) ||
(nRacial == RACIAL_TYPE_HALFORC) ||
(nRacial == RACIAL_TYPE_HUMANOID_MONSTROUS) ||
(nRacial == RACIAL_TYPE_HUMANOID_ORC) ||
(nRacial == RACIAL_TYPE_HUMANOID_REPTILIAN))
{
//SpeakString(IntToString(nAmount) + " and HD of " + IntToString(GetHitDice(oTarget)));
if(nAmount >= GetHitDice(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_MASS_CHARM, FALSE));
//Make an SR check
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr))
{
int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF);
//Make a Will save to negate
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (nDC), SAVING_THROW_TYPE_MIND_SPELLS))
{
if(GetIsEnemy(oTarget))
{
//Apply the linked effects and the VFX impact
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
else
{
//Only works if the creature is not already charmed (and not a pc)
if(GetLocalInt(oTarget, sCharmedVarName) != 1 && !GetIsPC(oTarget))
{
//Apply the linked effects and the VFX impact and adjust the PRR
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
SendMessageToPC(OBJECT_SELF, "You have charmed " + GetName(oTarget) + " and the effect will last for " + IntToString(nPRR_Duration / 24) + " days.");
PRR_CHARM_AffectTarget(oTarget, OBJECT_SELF, nPRR_Duration);
}
else
{
SendMessageToPC(OBJECT_SELF, "You have already charmed " + GetName(oTarget));
}
}
}
}
//Add the creatures HD to the count of affected creatures
//nCnt = nCnt + GetHitDice(oTarget);
nAmount = nAmount - GetHitDice(oTarget);
}
}
}
//Get next target in spell area
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation());
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}

View File

@ -0,0 +1,84 @@
/*
nw_s0_res.nss
Raise Dead, Resurrection
By: Flaming_Sword
Created: Jun 16, 2006
Modified: Jun 16, 2006
Consolidation of 2 scripts, cleaned up
*/
#include "69_hench_lib"
#include "prc_sp_func"
//Implements the spell impact, put code here
// if called in many places, return TRUE if
// stored charges should be decreased
// eg. touch attack hits
//
// Variables passed may be changed if necessary
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent)
{
int nSpellID = PRCGetSpellId();
int bRes = (nSpellID == SPELL_RESURRECTION);
if (GetIsObjectValid(oTarget))
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID, FALSE));
if (GetIsDead(oTarget)&& GetIsHenchmanDying(oTarget) == FALSE)
{
SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oTarget);
if(bRes) SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectHeal(GetMaxHitPoints(oTarget) + 10, oTarget), oTarget);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_RAISE_DEAD), GetLocation(oTarget));
ExecuteScript(bRes ? "prc_pw_res" : "prc_pw_raisedead", oCaster);
if(GetPRCSwitch(PRC_PW_DEATH_TRACKING) && GetIsPC(oTarget))
SetPersistantLocalInt(oTarget, "persist_dead", FALSE);
if(GetDidDie(oTarget)) //Added for henchman
{
PostRespawnCleanup69(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,oCaster);
}
}
}
return TRUE; //return TRUE if spell charges should be decremented
}
void main()
{
object oCaster = OBJECT_SELF;
int nCasterLevel = PRCGetCasterLevel(oCaster);
PRCSetSchool(GetSpellSchool(PRCGetSpellId()));
if (!X2PreSpellCastCode()) return;
object oTarget = PRCGetSpellTargetObject();
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
if(!nEvent) //normal cast
{
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
{ //holding the charge, casting spell on self
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
return;
}
DoSpell(oCaster, oTarget, nCasterLevel, nEvent);
}
else
{
if(nEvent & PRC_SPELL_EVENT_ATTACK)
{
if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent))
DecrementSpellCharges(oCaster);
}
}
PRCSetSchool();
}

View File

@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Aura of Blinding On Enter
//:: NW_S1_AuraBlndA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura of the creature the player
must make a will save or be blinded because of the
sheer ugliness or beauty of the creature.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD/3);
effect eBlind = EffectBlindness();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVis = EffectVisualEffect(VFX_IMP_BLIND_DEAF_M);
effect eLink = EffectLinkEffects(eBlind, eDur);
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
//Entering object must make a will save or be blinded for the duration.
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_AURA_BLINDING));
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC))
{
//Apply the blind effect and the VFX impact
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
}

View File

@ -0,0 +1,62 @@
//::///////////////////////////////////////////////
//:: Aura of Frost on Heartbeat
//:: NW_S1_AuraColdC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Prolonged exposure to the aura of the creature
causes frost damage to all within the aura.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nFrost = 1 + (nHD/3);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
//Get the first target in the aura of cold
oTarget = GetFirstInPersistentObject();
while (GetIsObjectValid(oTarget))
{
/* if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget))
{
oTarget = GetNextInPersistentObject(OBJECT_SELF);
continue;
} */
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_AURA_COLD));
//Roll damage based on the creatures HD
nDamage = d4(nFrost);
//Make a Fortitude save for half
if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_COLD))
{
nDamage = nDamage / 2;
}
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
//Apply the VFX constant and damage effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
//Get the next target in the aura of cold
oTarget = GetNextInPersistentObject();
}
}

View File

@ -0,0 +1,58 @@
//::///////////////////////////////////////////////
//:: Aura of Electricity on Heartbeat
//:: NW_S1_AuraElecC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Prolonged exposure to the aura of the creature
causes electrical damage to all within the aura.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
int nHD = GetHitDice(oNPC);
int nZap = 1 + (nHD / 3);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 + nCHAMod + (nHD/2);
int nDamage;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
//Get first target in spell area
object oTarget = GetFirstInPersistentObject();
while (GetIsObjectValid(oTarget))
{
/* if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget))
{
oTarget = GetNextInPersistentObject(OBJECT_SELF);
continue;
} */
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator()))
{
nDamage = d4(nZap);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_AURA_ELECTRICITY));
//Make a saving throw check
if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY))
{
nDamage = nDamage / 2;
}
eDam = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
//Apply the VFX impact and effects
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
//Get next target in spell area
oTarget = GetNextInPersistentObject();
}
}

View File

@ -0,0 +1,59 @@
//::///////////////////////////////////////////////
//:: Aura of Fire on Heartbeat
//:: NW_S1_AuraFireC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Prolonged exposure to the aura of the creature
causes fire damage to all within the aura.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetFirstInPersistentObject(); //:: Get first target in spell area
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nBurn = 1 + (nHD/3);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
int nDamSave;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
while(GetIsObjectValid(oTarget))
{
/* if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget))
{
oTarget = GetNextInPersistentObject(OBJECT_SELF);
continue;
} */
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELLABILITY_AURA_FIRE));
//Roll damage
nDamage = d4(nBurn);
//Make a saving throw check
if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_FIRE))
{
nDamage = nDamage / 2;
}
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
//Get next target in spell area
oTarget = GetNextInPersistentObject();
}
}

View File

@ -0,0 +1,46 @@
//::///////////////////////////////////////////////
//:: Aura of Menace On Enter
//:: NW_S1_AuraMencA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura all those that fail
a will save are stricken with Doom.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
int nDuration = 1 + (GetHitDice(oNPC)/3);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (GetHitDice(oNPC)/2);
int nLevel = PRCGetCasterLevel(OBJECT_SELF);
int nMetaMagic = PRCGetMetaMagicFeat();
effect eVis = EffectVisualEffect(VFX_IMP_DOOM);
effect eLink = CreateDoomEffectsLink();
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_AURA_MENACE));
//Spell Resistance and Saving throw
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC))
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink , oTarget, TurnsToSeconds(nDuration));
}
}
}

View File

@ -0,0 +1,35 @@
//::///////////////////////////////////////////////
//:: Aura of Protection: On Enter
//:: NW_S1_AuraProtA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Acts as a double strength Magic Circle against
evil and a Minor Globe for those friends in
the area.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On:Jan 8, 2002, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
void main()
{
//Declare major variables
effect eProt = CreateProtectionFromAlignmentLink(ALIGNMENT_EVIL);
effect eGlobe = EffectSpellLevelAbsorption(3, 0);
effect eDur = EffectVisualEffect(VFX_DUR_GLOBE_MINOR);
effect eLink = EffectLinkEffects(eProt, eGlobe);
eLink = EffectLinkEffects(eLink, eDur);
object oTarget = GetEnteringObject();
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
//Faction Check
if(GetIsFriend(oTarget, GetAreaOfEffectCreator()))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget);
}
}

View File

@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Aura Stunning On Enter
//:: NW_S1_AuraStunA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura of the creature the player
must make a will save or be stunned.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDuration = GetHitDice(oNPC);
int nDC = 10 + nCHAMod + (nDuration/2);
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
effect eVis = EffectVisualEffect(VFX_IMP_STUN);
effect eVis2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eDeath = EffectStunned();
effect eLink = EffectLinkEffects(eVis2, eDeath);
nDuration = GetScaledDuration(nDuration, oTarget);
if(!GetIsFriend(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_AURA_STUN));
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Aura of the Unnatural On Enter
//:: NW_S1_AuraMencA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura all animals are struck with
fear.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eFear = EffectFrightened();
effect eLink = EffectLinkEffects(eVis, eFear);
object oTarget = GetEnteringObject();
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
int nDuration = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nRacial = GetRacialType(oTarget);
int nDC = 10 + nCHAMod + (GetHitDice(oNPC)/2);
if(GetIsEnemy(oTarget))
{
nDuration = (nDuration / 3) + 1;
//Make a saving throw check
if(nRacial == RACIAL_TYPE_ANIMAL)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELLABILITY_AURA_UNNATURAL));
//if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR)) //:: This ability only affects animals & they don't get a save.
//{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
//}
}
}
}

View File

@ -0,0 +1,46 @@
//::///////////////////////////////////////////////
//:: Aura Unearthly Visage On Enter
//:: NW_S1_AuraUnEaA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura of the creature the player
must make a will save or be killed because of the
sheer ugliness or beauty of the creature.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
effect eDeath = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
if(GetIsEnemy(oTarget, oNPC))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_AURA_UNEARTHLY_VISAGE));
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget);
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@ -0,0 +1,66 @@
//::///////////////////////////////////////////////
//:: Bolt: Acid
//:: NW_S1_BltAcid
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int nCount = nHD/2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
effect eBolt;
//ankheg
if(GetAppearanceType(oNPC) == APPEARANCE_TYPE_BEETLE_SLICER)
{
nDamage = d4(4);
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_ACID));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_ACID);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Set damage effect
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_ACID);
if(nDamage > 0)
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@ -0,0 +1,47 @@
//::///////////////////////////////////////////////
//:: Bolt: Charm
//:: NW_S1_BltCharm
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
#include "NW_I0_SPELLS"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
nCount = GetScaledDuration(nCount, oTarget);
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
effect eBolt = EffectCharmed();
eBolt = GetScaledEffect(eBolt, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_CHARM));
//Make a saving throw check
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Charisma Drain
//:: NW_S1_BltChrDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Fortitude save is
needed to avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = nHD / 3;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_ABILITY_DRAIN_CHARISMA));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
eBolt = EffectAbilityDecrease(ABILITY_CHARISMA, nCount);
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,60 @@
//::///////////////////////////////////////////////
//:: Bolt: Cold
//:: NW_S1_BltCold
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = nHD/2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_COLD));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_COLD);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Set damage effect
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
if(nDamage > 0)
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Constitution Drain
//:: NW_S1_BltConDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Fort save is
needed to avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD /3);
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_ABILITY_DRAIN_CONSTITUTION));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
eBolt = EffectAbilityDecrease(ABILITY_CONSTITUTION, nCount);
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Confuse
//:: NW_S1_BltConf
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
#include "NW_I0_SPELLS"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
nCount = GetScaledDuration(nCount, oTarget);
effect eVis2 = EffectVisualEffect(VFX_IMP_CONFUSION_S);
effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eBolt = EffectConfused();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
eLink = EffectLinkEffects(eLink, eVis);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_CONFUSE));
//Make a saving throw check
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
}
}

View File

@ -0,0 +1,47 @@
//::///////////////////////////////////////////////
//:: Bolt: Daze
//:: NW_S1_BltDaze
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
#include "NW_I0_SPELLS"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
nCount = GetScaledDuration(nCount, oTarget);
effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eBolt = EffectDazed();
eBolt = GetScaledEffect(eBolt, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
eLink = EffectLinkEffects(eLink, eVis);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_DAZE));
//Make a saving throw check
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
}
}

View File

@ -0,0 +1,47 @@
//::///////////////////////////////////////////////
//:: Bolt: Death
//:: NW_S1_BltDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
effect eBolt = EffectDeath();
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_DEATH));
//Make a saving throw check
if(TouchAttackRanged(oTarget))
{
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_DEATH))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Dexterity Drain
//:: NW_S1_BltDexDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Fort save is
needed to avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_ABILITY_DRAIN_DEXTERITY));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
eBolt = EffectAbilityDecrease(ABILITY_DEXTERITY, nCount);
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,73 @@
//::///////////////////////////////////////////////
//:: Bolt: Disease
//:: NW_S1_BltDisease
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to infect
the target with a disease. The disease used
is chosen based upon the racial type of the
caster.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nRacial = MyPRCGetRacialType(oNPC);
int nDisease;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_DISEASE));
//Here we use the racial type of the attacker to select an
//appropriate disease.
switch (nRacial)
{
case RACIAL_TYPE_VERMIN:
nDisease = DISEASE_VERMIN_MADNESS;
break;
case RACIAL_TYPE_UNDEAD:
nDisease = DISEASE_FILTH_FEVER;
break;
case RACIAL_TYPE_OUTSIDER:
if(GetTag(oNPC) == "NW_SLAADRED")
{
nDisease = DISEASE_RED_SLAAD_EGGS;
}
else
{
nDisease = DISEASE_DEMON_FEVER;
}
break;
case RACIAL_TYPE_MAGICAL_BEAST:
nDisease = DISEASE_SOLDIER_SHAKES;
break;
case RACIAL_TYPE_ABERRATION:
nDisease = DISEASE_BLINDING_SICKNESS;
break;
default:
nDisease = DISEASE_SOLDIER_SHAKES;
break;
}
//Assign effect and chosen disease
effect eBolt = EffectDisease(nDisease);
//Make the ranged touch attack.
if (TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget);
}
}

View File

@ -0,0 +1,53 @@
//::///////////////////////////////////////////////
//:: Bolt: Dominated
//:: NW_S1_BltDomn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
nCount = GetScaledDuration(nCount, oTarget);
effect eVis = EffectVisualEffect(VFX_IMP_DOMINATE_S);
effect eBolt = EffectDominated();
eBolt = GetScaledEffect(eBolt, oTarget);
effect eVis2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED);
eBolt = GetScaledEffect(eBolt, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
eLink = EffectLinkEffects(eLink, eVis2);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_DOMINATE));
//Make a saving throw check
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,58 @@
//::///////////////////////////////////////////////
//:: Bolt: Fire
//:: NW_S1_BoltFire
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = nHD/2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_FIRE));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_FIRE);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Set damage effect
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Intelligence Drain
//:: NW_S1_BltIntDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_ABILITY_DRAIN_INTELLIGENCE));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
eBolt = EffectAbilityDecrease(ABILITY_INTELLIGENCE, nCount);
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Knockdown
//:: NW_S1_BltKnckD
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = nHD/2;
if (nCount == 0) { nCount = 1; }
effect eVis = EffectVisualEffect(VFX_IMP_SONIC);
effect eBolt = EffectKnockdown();
effect eDam = EffectDamage(d6(), DAMAGE_TYPE_BLUDGEONING);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_KNOCKDOWN));
//Make a saving throw check
if (!/*Reflex Save*/ PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBolt, oTarget, RoundsToSeconds(3));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
}

View File

@ -0,0 +1,59 @@
//::///////////////////////////////////////////////
//:: Bolt: Lightning
//:: NW_S1_BltLightn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Does 1d6 per level to a single target. Reflex
save for half
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Aug 10, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = nHD/2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, OBJECT_SELF,BODY_NODE_HAND);
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_LIGHTNING));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_ELECTRICITY);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Set damage effect
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
if(nDamage > 0)
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLightning, oTarget, 1.7);
}
}
}

View File

@ -0,0 +1,49 @@
//::///////////////////////////////////////////////
//:: Bolt: Level Drain
//:: NW_S1_BltLvlDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = nHD/5;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt = EffectNegativeLevel(1);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_LEVEL_DRAIN));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
//eBolt = LEVEL DRAIN EFFECT
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Paralyze
//:: NW_S1_BltParal
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
nCount = GetScaledDuration(nCount, oTarget);
effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED);
effect eBolt = EffectParalyze();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
eLink = EffectLinkEffects(eLink, eVis);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_PARALYZE));
//Make a saving throw check
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
}
}

View File

@ -0,0 +1,123 @@
//::///////////////////////////////////////////////
//:: Bolt: Poison
//:: NW_S1_BltPoison.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Must make a ranged touch attack. If successful
the target is struck down with poison that
scales with level.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 22, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nRacial = MyPRCGetRacialType(OBJECT_SELF);
int nPoison;
effect ePoison;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_POISON));
//Determine the poison type based on the Racial Type and HD
switch (nRacial)
{
case RACIAL_TYPE_OUTSIDER:
if (nHD <= 9)
{
nPoison = POISON_QUASIT_VENOM;
}
else if (nHD > 9 && nHD < 13)
{
nPoison = POISON_BEBILITH_VENOM;
}
else if (nHD >= 13)
{
nPoison = POISON_PIT_FIEND_ICHOR;
}
break;
case RACIAL_TYPE_VERMIN:
if (nHD < 3)
{
nPoison = POISON_TINY_SPIDER_VENOM;
}
else if (nHD <= 3 && nHD < 6)
{
nPoison = POISON_SMALL_SPIDER_VENOM;
}
else if (nHD <= 6 && nHD < 9)
{
nPoison = POISON_MEDIUM_SPIDER_VENOM;
}
else if (nHD <= 9 && nHD < 12)
{
nPoison = POISON_LARGE_SPIDER_VENOM;
}
else if (nHD <= 12 && nHD < 15)
{
nPoison = POISON_HUGE_SPIDER_VENOM;
}
else if (nHD <= 15 && nHD < 18)
{
nPoison = POISON_GARGANTUAN_SPIDER_VENOM;
}
else if (nHD >= 18)
{
nPoison = POISON_COLOSSAL_SPIDER_VENOM;
}
break;
default:
if (nHD < 3)
{
nPoison = POISON_NIGHTSHADE;
}
else if (nHD <= 3 && nHD < 6)
{
nPoison = POISON_BLADE_BANE;
}
else if (nHD <= 6 && nHD < 9)
{
nPoison = POISON_BLOODROOT;
}
else if (nHD <= 9 && nHD < 12)
{
nPoison = POISON_LARGE_SPIDER_VENOM;
}
else if (nHD <= 12 && nHD < 15)
{
nPoison = POISON_LICH_DUST;
}
else if (nHD <= 15 && nHD < 18)
{
nPoison = POISON_DARK_REAVER_POWDER;
}
else if (nHD >= 18 )
{
nPoison = POISON_BLACK_LOTUS_EXTRACT;
}
break;
}
//Make a ranged touch attack
if (TouchAttackRanged (oTarget))
{
ePoison = EffectPoison(nPoison);
//Apply effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoison, oTarget);
}
}

View File

@ -0,0 +1,58 @@
//::///////////////////////////////////////////////
//:: Bolt: Shards
//:: NW_S1_BltShard
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_SHARDS));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Set damage effect
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_PIERCING, DAMAGE_POWER_PLUS_ONE);
if(nDamage > 0)
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
}
}
}

View File

@ -0,0 +1,47 @@
//::///////////////////////////////////////////////
//:: Bolt: Slow
//:: NW_S1_BltSlow
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex save is
needed to or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: June 18 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
effect eVis = EffectVisualEffect(VFX_IMP_SLOW);
effect eBolt = EffectSlow();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_SLOW));
//Make a saving throw check
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Strength Drain
//:: NW_S1_BltStrDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Fort save is
needed to avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_ABILITY_DRAIN_STRENGTH));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
eBolt = EffectAbilityDecrease(ABILITY_STRENGTH, nCount);
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,50 @@
//::///////////////////////////////////////////////
//:: Bolt: Stun
//:: NW_S1_BltStun
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
nCount = GetScaledDuration(nCount, oTarget);
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_STUN);
effect eBolt = EffectStunned();
eBolt = GetScaledEffect(eBolt, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_STUN));
//Make a saving throw check
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,44 @@
//::///////////////////////////////////////////////
//:: Bolt: Web
//:: NW_S1_BltWeb
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Glues a single target to the ground with
sticky strands of webbing.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 28, 2002
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int nCount = 1 + (nHD /2);
if (nCount == 0) { nCount = 1; }
effect eVis = EffectVisualEffect(VFX_DUR_WEB);
effect eStick = EffectEntangle();
effect eLink = EffectLinkEffects(eVis, eStick);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_WEB));
//Make a saving throw check
if (!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
}
}

View File

@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Wisdom Drain
//:: NW_S1_BltWisDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Fort save is
needed to avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD /3);
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_ABILITY_DRAIN_WISDOM));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
eBolt = EffectAbilityDecrease(ABILITY_WISDOM, nCount);
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,76 @@
//::///////////////////////////////////////////////
//:: Cone: Acid
//:: NW_S1_ConeAcid
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A cone of damage eminated from the monster. Does
a set amount of damage based upon the creatures HD
and can be halved with a Reflex Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
int nLoop = nHD / 3;
float fDelay;
if(nLoop == 0)
{
nLoop = 1;
}
//Calculate the damage
for (nLoop; nLoop > 0; nLoop--)
{
nDamage = nDamage + d6(2);
}
location lTargetLocation = PRCGetSpellTargetLocation();
effect eCone;
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_CONE_ACID));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_ACID);
//Set damage effect
eCone = EffectDamage(nDamage, DAMAGE_TYPE_ACID);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,76 @@
//::///////////////////////////////////////////////
//:: Cone: Cold
//:: NW_S1_ConeCold
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A cone of damage eminated from the monster. Does
a set amount of damage based upon the creatures HD
and can be halved with a Reflex Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
int nLoop = nHD / 3;
float fDelay;
if(nLoop == 0)
{
nLoop = 1;
}
//Calculate the damage
for (nLoop; nLoop > 0; nLoop--)
{
nDamage = nDamage + d6(2);
}
location lTargetLocation = PRCGetSpellTargetLocation();
effect eCone;
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_CONE_COLD));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_COLD);
//Set damage effect
eCone = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,99 @@
//::///////////////////////////////////////////////
//:: Cone: Disease
//:: NW_S1_ConeDisea
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature spits out a cone of disease that cannot
be avoided unless a Reflex save is made.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 22, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nRacial = MyPRCGetRacialType(oNPC);
int nDisease;
location lTargetLocation = PRCGetSpellTargetLocation();
float fDelay;
effect eCone = EffectDisease(nDisease);
effect eVis = EffectVisualEffect(VFX_IMP_DISEASE_S);
//Determine the disease type based on the Racial Type and HD
switch (nRacial)
{
case RACIAL_TYPE_OUTSIDER:
nDisease = DISEASE_DEMON_FEVER;
break;
case RACIAL_TYPE_VERMIN:
nDisease = DISEASE_VERMIN_MADNESS;
break;
case RACIAL_TYPE_UNDEAD:
if(nHD <= 3)
{
nDisease = DISEASE_ZOMBIE_CREEP;
}
else if (nHD > 3 && nHD <= 10)
{
nDisease = DISEASE_GHOUL_ROT;
}
else if(nHD > 10)
{
nDisease = DISEASE_MUMMY_ROT;
}
default:
if(nHD <= 3)
{
nDisease = DISEASE_MINDFIRE;
}
else if (nHD > 3 && nHD <= 10)
{
nDisease = DISEASE_RED_ACHE;
}
else if(nHD > 10)
{
nDisease = DISEASE_SHAKES;
}
break;
}
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_CONE_DISEASE));
//Get the delay time
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,78 @@
//::///////////////////////////////////////////////
//:: Cone: Lightning
//:: NW_S1_ConeElec
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A cone of damage eminates from the monster. Does
a set amount of damage based upon the creatures HD
and can be halved with a Reflex Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
int nLoop = nHD / 3;
float fDelay;
if(nLoop == 0)
{
nLoop = 1;
}
//Calculate the damage
for (nLoop; nLoop > 0; nLoop--)
{
nDamage = nDamage + d6(2);
}
location lTargetLocation = PRCGetSpellTargetLocation();
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oNPC, BODY_NODE_HAND);
effect eCone;
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_CONE_LIGHTNING));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY);
//Set damage effect
eCone = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oTarget,0.5));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,75 @@
//::///////////////////////////////////////////////
//:: Cone: Sonic
//:: NW_S1_ConeSonic
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A cone of damage eminated from the monster. Does
a set amount of damage based upon the creatures HD
and can be halved with a Reflex Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
int nLoop = nHD / 3;
float fDelay;
if(nLoop == 0)
{
nLoop = 1;
}
//Calculate the damage
for (nLoop; nLoop > 0; nLoop--)
{
nDamage = nDamage + d6(2);
}
location lTargetLocation = PRCGetSpellTargetLocation();
effect eCone;
effect eVis = EffectVisualEffect(VFX_IMP_SONIC);
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_CONE_SONIC));
//Determine effect delay
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,DAMAGE_TYPE_SONIC);
//Set damage effect
eCone = EffectDamage(nDamage, DAMAGE_TYPE_SONIC);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,119 @@
//::///////////////////////////////////////////////
//:: Dragon Breath Fear
//:: NW_S1_DragFear
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Calculates the proper DC Save for the
breath weapon based on the HD of the dragon.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//Declare major variables
int nAge = GetHitDice(OBJECT_SELF);
int nCount;
int nDC;
float fDelay;
object oTarget;
effect eBreath = EffectFrightened();
effect eFear = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eVis = EffectVisualEffect(VFX_IMP_FEAR_S);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBreath, eDur);
eLink = EffectLinkEffects(eLink, eFear);
//Determine the duration and save DC
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;
}
PlayDragonBattleCry();
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 14.0, PRCGetSpellTargetLocation(), TRUE);
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(oTarget != OBJECT_SELF && !GetIsReactionTypeFriendly(oTarget))
{
nCount = GetScaledDuration(nCount, oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_DRAGON_BREATH_FEAR));
//Determine the effect delay time
fDelay = GetDistanceBetween(oTarget, OBJECT_SELF)/20;
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR, OBJECT_SELF, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount)));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 14.0, PRCGetSpellTargetLocation(), TRUE);
}
}

View File

@ -0,0 +1,45 @@
//::///////////////////////////////////////////////
//:: Aura of Fear On Enter
//:: NW_S1_DragFearA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura of the creature the player
must make a will save or be struck with fear because
of the creatures presence.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//Declare major variables
object oTarget = GetEnteringObject();
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
effect eVis = EffectVisualEffect(VFX_IMP_FEAR_S);
effect eDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eFear = EffectFrightened();
effect eLink = EffectLinkEffects(eFear, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
int nHD = GetHitDice(GetAreaOfEffectCreator());
int nDC = 10 + GetHitDice(GetAreaOfEffectCreator())/3;
int nDuration = GetScaledDuration(nHD, oTarget);
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELLABILITY_AURA_FEAR));
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@ -0,0 +1,41 @@
//::///////////////////////////////////////////////
//:: Ferocity 3
//:: NW_S1_Feroc3
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
The Dex and Str of the target increases
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Aug 13, 2001
//:://////////////////////////////////////////////
void main()
{
//:: Declare major variables
object oNPC = OBJECT_SELF;
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION); //:: Determine the duration by getting the con modifier
int nIncrease = 9;
int nDuration = 1 + nCONMod;
if(nDuration == 0) { nDuration = 1; }
effect eDex = EffectAbilityIncrease(ABILITY_DEXTERITY, nIncrease);
effect eStr = EffectAbilityIncrease(ABILITY_STRENGTH, nIncrease);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eLink = EffectLinkEffects(eStr, eDex);
eLink = EffectLinkEffects(eLink, eDur);
eLink = ExtraordinaryEffect(eLink); //:: Make effect extraordinary
//effect eVis = EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE);
SignalEvent(oNPC, EventSpellCastAt(oNPC, SPELLABILITY_FEROCITY_3, FALSE));
if (nCONMod > 0)
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oNPC, RoundsToSeconds(nDuration));
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF) ;
}
}

View File

@ -0,0 +1,69 @@
//::///////////////////////////////////////////////
//:: Gaze: Destroy Law
//:: NW_S1_GazeChaos
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save and are of Lawful alignment.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 13, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
location lTargetLocation = PRCGetSpellTargetLocation();
effect eGaze = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
if(GetAlignmentLawChaos(oTarget) == ALIGNMENT_LAWFUL)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DESTROY_LAW));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!/*WillSave*/PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
//DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,76 @@
//::///////////////////////////////////////////////
//:: Gaze: Charm
//:: NW_S1_GazeCharm
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
location lTargetLocation = PRCGetSpellTargetLocation();
effect eGaze = EffectCharmed();
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVisDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
effect eLink = EffectLinkEffects(eDur, eVisDur);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
{
nDuration = GetScaledDuration(nDuration, oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_CHARM));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
eGaze = GetScaledEffect(eGaze, oTarget);
eLink = EffectLinkEffects(eLink, eGaze);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,77 @@
//::///////////////////////////////////////////////
//:: Gaze: Confusion
//:: NW_S1_GazeConfu
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
location lTargetLocation = PRCGetSpellTargetLocation();
effect eGaze = EffectConfused();
effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVisDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eLink = EffectLinkEffects(eDur, eVisDur);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
if(oTarget != oNPC)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_CONFUSION));
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
eGaze = GetScaledEffect(eGaze, oTarget);
eLink = EffectLinkEffects(eLink, eGaze);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,74 @@
//::///////////////////////////////////////////////
//:: Gaze: Daze
//:: NW_S1_GazeDaze
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
location lTargetLocation = PRCGetSpellTargetLocation();
effect eGaze = EffectDazed();
effect eVis = EffectVisualEffect(VFX_IMP_DAZED_S);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVisDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eLink = EffectLinkEffects(eGaze, eVisDur);
eLink = EffectLinkEffects(eLink, eDur);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DAZE));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!/*WillSave*/PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,66 @@
//::///////////////////////////////////////////////
//:: Gaze: Death
//:: NW_S1_GazeDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
location lTargetLocation = PRCGetSpellTargetLocation();
effect eGaze = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) || oTarget != oNPC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DEATH));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,78 @@
//::///////////////////////////////////////////////
//:: Gaze: Dominate
//:: NW_S1_GazeDomn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
location lTargetLocation = PRCGetSpellTargetLocation();
effect eGaze = EffectDominated();
effect eVis = EffectVisualEffect(VFX_IMP_DOMINATE_S);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVisDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED);
effect eLink = EffectLinkEffects(eDur, eVisDur);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DOMINATE));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(GetIsEnemy(oTarget))
{
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
eGaze = GetScaledEffect(eGaze, oTarget);
eLink = EffectLinkEffects(eLink, eGaze);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,74 @@
//::///////////////////////////////////////////////
//:: Gaze of Doom
//:: NW_S1_GazeDoom.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
If the target fails a save they recieve a -2
penalty to all saves, attack rolls, damage and
skill checks for the duration of the spell.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 22, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
location lTargetLocation = PRCGetSpellTargetLocation();
effect eVis = EffectVisualEffect(VFX_IMP_DOOM);
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);
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, PRCGetSpellTargetLocation());
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
if(oTarget != oNPC)
{
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DOOM));
//Spell Resistance and Saving throw
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC))
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink , oTarget, RoundsToSeconds(nDuration));
}
}
}
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, PRCGetSpellTargetLocation());
}
}

View File

@ -0,0 +1,70 @@
//::///////////////////////////////////////////////
//:: Gaze: Deatroy Good
//:: NW_S1_GazeEvil
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 13, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
location lTargetLocation = PRCGetSpellTargetLocation();
effect eGaze = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_GOOD)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DEATH));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
//DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,74 @@
//::///////////////////////////////////////////////
//:: Gaze: Fear
//:: NW_S1_GazeFear
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
nDuration = GetScaledDuration(nDuration , oTarget);
location lTargetLocation = PRCGetSpellTargetLocation();
effect eGaze = EffectFrightened();
effect eVis = EffectVisualEffect(VFX_IMP_FEAR_S);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVisDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eLink = EffectLinkEffects(eGaze, eVisDur);
eLink = EffectLinkEffects(eLink, eDur);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
nDuration = GetScaledDuration(nDuration , oTarget);
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_FEAR));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,70 @@
//::///////////////////////////////////////////////
//:: Gaze: Deatroy Evil
//:: NW_S1_GazeGood
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 13, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
location lTargetLocation = PRCGetSpellTargetLocation();
effect eGaze = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_EVIL)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DEATH));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
//DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,71 @@
//::///////////////////////////////////////////////
//:: Gaze: Deatroy Chaos
//:: NW_S1_GazeLaw
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 13, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
location lTargetLocation = PRCGetSpellTargetLocation();
effect eGaze = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
if(GetAlignmentLawChaos(oTarget) == ALIGNMENT_CHAOTIC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DESTROY_LAW));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!/*WillSave*/PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
//DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,73 @@
//::///////////////////////////////////////////////
//:: Gaze: Stun
//:: NW_S1_GazeStun
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
location lTargetLocation = PRCGetSpellTargetLocation();
effect eGaze = EffectStunned();
effect eVis = EffectVisualEffect(VFX_IMP_STUN);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVisDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eLink = EffectLinkEffects(eDur, eVisDur);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_STUNNED));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!/*WillSave*/PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
eGaze = GetScaledEffect(eGaze, oTarget);
eLink = EffectLinkEffects(eLink, eGaze);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,43 @@
//::///////////////////////////////////////////////
//:: Golem Breath
//:: NW_S1_GolemGas
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Iron Golem spits out a cone of poison.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 22, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//Declare major variables
location lTargetLocation = PRCGetSpellTargetLocation();
object oTarget;
effect eCone = EffectPoison(POISON_IRON_GOLEM);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_GOLEM_BREATH_GAS));
//Determine effect delay
float fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
//Apply poison effect
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,66 @@
//::///////////////////////////////////////////////
//:: Hell Hound Fire Breath
//:: NW_S1_HndBreath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A cone of fire eminates from the hound.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int nDamage = d6(2);
float fDelay;
location lTargetLocation = PRCGetSpellTargetLocation();
effect eCone;
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HELL_HOUND_FIREBREATH));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_FIRE);
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Set damage effect
eCone = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
}
}

View File

@ -0,0 +1,67 @@
//::///////////////////////////////////////////////
//:: Howl: Confuse
//:: NW_S1_HowlConf
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 20ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
int nDuration = 1 + (nHD/4);
if(nDuration == 0) { nDuration = 1; }
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S);
effect eHowl = EffectConfused();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_MIND);
effect eLink = EffectLinkEffects(eHowl, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != oNPC)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_CONFUSE));
fDelay = GetDistanceToObject(oTarget)/10;
//Make a saving throw check
if(!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,65 @@
//::///////////////////////////////////////////////
//:: Howl: Daze
//:: NW_S1_HowlDaze
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 10ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
int nDuration = 1 + (nHD/4);
if(nDuration == 0) { nDuration = 1; }
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_DAZED_S);
effect eHowl = EffectDazed();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_MIND);
effect eLink = EffectLinkEffects(eHowl, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != oNPC)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_DAZE));
fDelay = GetDistanceToObject(oTarget)/10;
//Make a saving throw check
if(!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,59 @@
//::///////////////////////////////////////////////
//:: Howl: Death
//:: NW_S1_HowlDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 10ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_ODD);
effect eHowl = EffectDeath();
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != oNPC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_DEATH));
fDelay = GetDistanceToObject(oTarget)/10;
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,68 @@
//::///////////////////////////////////////////////
//:: Howl: Fear
//:: NW_S1_HowlFear
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 10ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
int nDuration = 1 + (nHD/4);
if(nDuration == 0) { nDuration = 1; }
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_FEAR_S);
effect eHowl = EffectFrightened();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_MIND);
effect eLink = EffectLinkEffects(eHowl, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != oNPC)
{
fDelay = GetDistanceToObject(oTarget)/10;
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_FEAR));
//Make a saving throw check
if(!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,65 @@
//::///////////////////////////////////////////////
//:: Howl: Paralysis
//:: NW_S1_HowlParal
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 10ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
int nDuration = 1 + (nHD/4);
if(nDuration == 0) { nDuration = 1; }
float fDelay;
effect eHowl = EffectParalyze();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_PARALYZE_HOLD);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_ODD);
effect eLink = EffectLinkEffects(eHowl, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != oNPC)
{
fDelay = GetDistanceToObject(oTarget)/10;
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_PARALYSIS));
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_NONE, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,65 @@
//::///////////////////////////////////////////////
//:: Howl: Sonic
//:: NW_S1_HowlSonic
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 10ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
int nDamage;
int nSonic = nHD/4;
if(nSonic == 0) { nSonic = 1; }
effect eVis = EffectVisualEffect(VFX_IMP_SONIC);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_WAR_CRY);
float fDelay;
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsFriend(oTarget) && oTarget != oNPC)
{
fDelay = GetDistanceToObject(oTarget)/20;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_SONIC));
nDamage = d6(nSonic);
//Make a saving throw check
if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_SONIC, oNPC, fDelay))
{
nDamage = nDamage / 2;
}
//Set damage effect
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_SONIC);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,66 @@
//::///////////////////////////////////////////////
//:: Howl: Stun
//:: NW_S1_HowlStun
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 10ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
//#include "wm_include"
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
int nDuration = 1 + (nHD/4);
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_STUN);
effect eHowl = EffectStunned();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_MIND);
effect eLink = EffectLinkEffects(eHowl, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != oNPC)
{
fDelay = GetDistanceToObject(oTarget)/10;
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_STUN));
//Make a saving throw check
if(!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,61 @@
//::///////////////////////////////////////////////
//:: Krenshar Fear Stare
//:: NW_S1_KrenScare
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Causes those in the gaze to be struck with fear
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 8, 2002
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nMetaMagic = PRCGetMetaMagicFeat();
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_FEAR_S);
effect eFear = EffectFrightened();
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Link the fear and mind effects
effect eLink = EffectLinkEffects(eFear, eMind);
eLink = EffectLinkEffects(eLink, eDur);
//Get first target in the spell cone
oTarget = GetFirstObjectInShape(SHAPE_CONE, 10.0, PRCGetSpellTargetLocation(), TRUE);
while(GetIsObjectValid(oTarget))
{
//Make faction check
if(GetIsEnemy(oTarget))
{
fDelay = GetDistanceToObject(oTarget)/20;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_KRENSHAR_SCARE));
//Make a will save
if(!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR))
{
//Apply the linked effects and the VFX impact
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(3)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target in the spell cone
oTarget = GetNextObjectInShape(SHAPE_CONE, 10.0, PRCGetSpellTargetLocation(), TRUE);
}
}

View File

@ -0,0 +1,63 @@
//::///////////////////////////////////////////////
//:: Salt Mephit Breath
//:: NW_S1_MephSalt
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Salt Mephit shoots out a bolt of corrosive material
that causes 1d4 damage and reduces AC and Attack by 2
This should be a cone - Jaysyn
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int nDamage = d4();
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
effect eBolt, eAttack, eAC;
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_ACID);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nDamage == 0) {nTouch = 0;}
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_MEPHIT_SALT_BREATH));
//Set damage, AC mod and attack mod effects
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_ACID);
eAC = EffectACDecrease(2);
eAttack = EffectAttackDecrease(2);
effect eLink = EffectLinkEffects(eAttack, eAC);
eLink = EffectLinkEffects(eLink, eDur);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(3));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,67 @@
//::///////////////////////////////////////////////
//:: Steam Mephit Breath
//:: NW_S1_MephSteam
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Steam Mephit shoots out a bolt of steam
that causes 1d4 damage and reduces AC by 4
and Attack by 2
This should be a cone - Jaysyn
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int nDamage = d4();
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
effect eBolt, eAttack, eAC;
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_FIRE);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nDamage == 0) {nTouch = 0;}
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_MEPHIT_STEAM_BREATH));
//Set damage, AC mod and attack mod effects
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
eAC = EffectACDecrease(4);
eAttack = EffectAttackDecrease(2);
effect eLink = EffectLinkEffects(eAC, eAttack);
eLink = EffectLinkEffects(eLink, eDur);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(3));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@ -0,0 +1,53 @@
//::///////////////////////////////////////////////
//:: Bolster Undead
//:: NW_S1_MumUndead
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This spell increases the Turn Resistance of
all undead around the caster by an amount
scaled with HD.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 22, 2002
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nScaling = nHD / 4;
if(nScaling == 0) {nScaling = 1;}
float fDelay;
effect eTurn = EffectTurnResistanceIncrease(nScaling);
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_EVIL);
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_EVIL_30);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetLocation(oNPC));
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(GetIsFriend(oTarget))
{
fDelay = GetRandomDelay();
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_MUMMY_BOLSTER_UNDEAD, FALSE));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eTurn, oTarget, RoundsToSeconds(10)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,73 @@
//::///////////////////////////////////////////////
//:: Pulse: Charisma Drain
//:: 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.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_ABILITY_DRAIN_CHARISMA));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Make a saving throw check
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Set the Ability mod and change to supernatural effect
eHowl = EffectAbilityDecrease(ABILITY_CHARISMA, nDamage);
eHowl = SupernaturalEffect(eHowl);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get first target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,68 @@
//::///////////////////////////////////////////////
//:: Pulse: Cold
//:: NW_S1_PulsCold
//:: 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.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = d6(nHD);
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_COLD);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_COLD));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_COLD);
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,71 @@
//::///////////////////////////////////////////////
//:: Pulse: Constitution Drain
//:: 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.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_ABILITY_DRAIN_CONSTITUTION));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Make a saving throw check
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Set the Ability mod and change to supernatural effect
eHowl = EffectAbilityDecrease(ABILITY_CONSTITUTION, nDamage);
eHowl = SupernaturalEffect(eHowl);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get first target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,68 @@
//::///////////////////////////////////////////////
//:: Pulse: Death
//:: 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.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
effect eHowl = EffectDeath();
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget))
{
if(oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_DEATH));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
//DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,70 @@
//::///////////////////////////////////////////////
//:: Pulse: Dexterity Drain
//:: 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.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_ABILITY_DRAIN_DEXTERITY));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Make a saving throw check
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Set the Ability mod and change to supernatural effect
eHowl = EffectAbilityDecrease(ABILITY_DEXTERITY, nDamage);
eHowl = SupernaturalEffect(eHowl);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get first target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,85 @@
//::///////////////////////////////////////////////
//:: Pulse: Disease
//:: NW_S1_PulsDis
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of disease spreads out from the creature
and infects all those within 10ft
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Aug 14, 2000
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nRacial = MyPRCGetRacialType(oNPC);
int nHD = GetHitDice(oNPC);
int nDamage = d6(nHD);
int nDisease;
float fDelay;
effect eDisease;
effect ePulse = EffectVisualEffect(266);
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NATURE);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, ePulse, GetLocation(oNPC));
//Determine the disease type based on the Racial Type
switch (nRacial)
{
case RACIAL_TYPE_VERMIN:
nDisease = DISEASE_VERMIN_MADNESS;
break;
case RACIAL_TYPE_UNDEAD:
nDisease = DISEASE_FILTH_FEVER;
break;
case RACIAL_TYPE_OUTSIDER:
nDisease = DISEASE_DEMON_FEVER;
break;
case RACIAL_TYPE_MAGICAL_BEAST:
nDisease = DISEASE_SOLDIER_SHAKES;
break;
case RACIAL_TYPE_ABERRATION:
nDisease = DISEASE_BLINDING_SICKNESS;
break;
default:
nDisease = DISEASE_MINDFIRE;
break;
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_DISEASE));
//Determine effect delay
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
eDisease = EffectDisease(nDisease);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDisease, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,68 @@
//::///////////////////////////////////////////////
//:: Pulse: Lightning
//:: NW_S0_CallLghtn.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
All creatures within 10ft of the creature take
1d6 per HD up to 10d6
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 22, 2001
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oNPC, BODY_NODE_CHEST);
effect eHowl = EffectVisualEffect(VFX_IMP_PULSE_COLD);
DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eHowl, GetLocation(oNPC)));
float fDelay;
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_LIGHTNING));
//Roll the damage
nDamage = d6(nHD);
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY);
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oTarget, 0.5));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,69 @@
//::///////////////////////////////////////////////
//:: Pulse: Fire
//:: NW_S1_PulsFire
//:: 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.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_FIRE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
while(GetIsObjectValid(oTarget))
{
if(oTarget != OBJECT_SELF)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_FIRE));
//Roll the damage
nDamage = d6(nHD);
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_FIRE);
//Determine effect delay
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
}
}

View File

@ -0,0 +1,89 @@
//::///////////////////////////////////////////////
//:: 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.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_M);
effect eVis2 = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_HOLY);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Roll the amount to heal or damage
nDamage = d4(nHD);
//If the target is not undead
if (MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
//Make a faction check
if(oTarget != oNPC)
{
if(GetIsFriend(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, 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 = PRCGetReflexAdjustedDamage(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(oNPC, 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(oNPC));
}
}

View File

@ -0,0 +1,72 @@
//::///////////////////////////////////////////////
//:: Pulse: Intelligence Drain
//:: 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.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_ABILITY_DRAIN_INTELLIGENCE));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Make a saving throw check
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Set the Ability mod and change to supernatural effect
eHowl = EffectAbilityDecrease(ABILITY_INTELLIGENCE, nDamage);
eHowl = SupernaturalEffect(eHowl);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get first target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
}
}

View File

@ -0,0 +1,62 @@
//::///////////////////////////////////////////////
//:: Pulse: Level Drain
//:: NW_S1_PulsLvlDr
//:: 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.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetLocation(oNPC));
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
fDelay = GetSpellEffectDelay(GetLocation(oNPC), oTarget)/20;
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Apply the VFX impact and effects
eHowl = EffectNegativeLevel(1);
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,87 @@
//::///////////////////////////////////////////////
//:: 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.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_M);
effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Roll the amount to heal or damage
nDamage = d4(nHD);
//If the target is undead
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
{
//Make a faction check
if(GetIsFriend(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, 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) && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(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(oNPC, 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(oNPC));
}
}

View File

@ -0,0 +1,138 @@
//::///////////////////////////////////////////////
//:: Pulse: Poison
//:: NW_S1_PulsPois
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. All who make a reflex save are not
poisoned.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 23, 2000
//:://////////////////////////////////////////////
#include "prc_inc_racial"
//#include "wm_include"
void main()
{
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int nRacial = MyPRCGetRacialType(oNPC);
int nPoison;
float fDelay;
effect ePoison;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NATURE);
//Determine the poison type based on the Racial Type and HD
switch (nRacial)
{
case RACIAL_TYPE_OUTSIDER:
if (nHD <= 9)
{
nPoison = POISON_QUASIT_VENOM;
}
else if (nHD > 9 && nHD < 13)
{
nPoison = POISON_BEBILITH_VENOM;
}
else if (nHD >= 13)
{
nPoison = POISON_PIT_FIEND_ICHOR;
}
break;
case RACIAL_TYPE_VERMIN:
if (nHD < 3)
{
nPoison = POISON_TINY_SPIDER_VENOM;
}
else if (nHD <= 3 && nHD < 6)
{
nPoison = POISON_SMALL_SPIDER_VENOM;
}
else if (nHD <= 6 && nHD < 9)
{
nPoison = POISON_MEDIUM_SPIDER_VENOM;
}
else if (nHD <= 9 && nHD < 12)
{
nPoison = POISON_LARGE_SPIDER_VENOM;
}
else if (nHD <= 12 && nHD < 15)
{
nPoison = POISON_HUGE_SPIDER_VENOM;
}
else if (nHD <= 15 && nHD < 18)
{
nPoison = POISON_GARGANTUAN_SPIDER_VENOM;
}
else if (nHD >= 18)
{
nPoison = POISON_COLOSSAL_SPIDER_VENOM;
}
break;
default:
if (nHD < 3)
{
nPoison = POISON_NIGHTSHADE;
}
else if (nHD <= 3 && nHD < 6)
{
nPoison = POISON_BLADE_BANE;
}
else if (nHD <= 6 && nHD < 9)
{
nPoison = POISON_BLOODROOT;
}
else if (nHD <= 9 && nHD < 12)
{
nPoison = POISON_LARGE_SPIDER_VENOM;
}
else if (nHD <= 12 && nHD < 15)
{
nPoison = POISON_LICH_DUST;
}
else if (nHD <= 15 && nHD < 18)
{
nPoison = POISON_DARK_REAVER_POWDER;
}
else if (nHD >= 18 )
{
nPoison = POISON_BLACK_LOTUS_EXTRACT;
}
break;
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_POISON));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
ePoison = EffectPoison(nPoison);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoison, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,50 @@
//::///////////////////////////////////////////////
//:: Vrock Spores
//:: NW_S1_PulsSpore
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of disease spreads out from the creature
and infects all those within 10ft
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 8, 2002
//:://////////////////////////////////////////////
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
float fDelay;
effect eDisease;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NATURE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_DISEASE));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
eDisease = EffectDisease(DISEASE_SOLDIER_SHAKES);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDisease, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,71 @@
//::///////////////////////////////////////////////
//:: Pulse: Strength Drain
//:: 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.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_ABILITY_DRAIN_STRENGTH));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Make a saving throw check
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Set the Ability mod and change to supernatural effect
eHowl = EffectAbilityDecrease(ABILITY_STRENGTH, nDamage);
eHowl = SupernaturalEffect(eHowl);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@ -0,0 +1,51 @@
//::///////////////////////////////////////////////
//:: Pulse Whirlwind
//:: NW_S1_PulsWind
//:: Copyright (c) 2001 Bioware Corp.
//::///////////////////////////////////////////////
/*
All those that fail a save are knocked
down by the elemental whirlwind.
*/
//::///////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 8, 2002
//::///////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nSTRMod = GetAbilityModifier(ABILITY_STRENGTH, oNPC);
int nDC = 10 +nSTRMod+ (nHD/2);
effect eDown = EffectKnockdown();
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_WIND);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDown, oTarget, 5.0);
}
//Get next target in spell area
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

Some files were not shown because too many files have changed in this diff Show More