FunkySwerve wrote...
Whups, got distracted and forgot the spellhook. Ours is pretty simple, really, without too much focus on altering individual spells. Here it is:
#include "hg_inc"
#include "x2_inc_switches"
void main () {
/* Underwater effects on spells, by FunkySwerve */
int nSpellId = GetSpellId();
object oParty = GetFirstFactionMember(OBJECT_SELF, TRUE);
switch (nSpellId) {
case SPELL_BALL_LIGHTNING:
case SPELL_CALL_LIGHTNING:
case SPELL_CHAIN_LIGHTNING:
case SPELL_ELECTRIC_JOLT:
case SPELL_GEDLEES_ELECTRIC_LOOP:
case SPELL_LIGHTNING_BOLT:
case SPELL_SCINTILLATING_SPHERE:
case HGSPELL_GREATER_ORB_OF_ELECTRICITY:
case HGSPELL_LESSER_ORB_OF_ELECTRICITY:
case HGSPELL_ORB_OF_ELECTRICITY: {
/* electrical spells damage everyone in the casters party in the same
* area, for 6 points dmg /casterlevel, and then the spell casts normally */
int nDamage;
float fDist, fDamage;
effect eEffect, eVis;
object oArea = GetArea(OBJECT_SELF);
int nAmount = GetCasterLevel(OBJECT_SELF) * 6;
while (GetIsObjectValid(oParty)) {
if (GetArea(oParty) == oArea) {
fDist = GetDistanceBetween(OBJECT_SELF, oParty);
fDamage = (IntToFloat(nAmount) - fDist);
nDamage = FloatToInt(fDamage);
eEffect = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
fDist = fDist / 100;
DelayCommand(fDist, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oParty));
DelayCommand(fDist + 0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oParty));
}
oParty = GetNextFactionMember(OBJECT_SELF, TRUE);
}
FloatingTextStringOnCreature("The electricity arcs through the water, damaging your party.", OBJECT_SELF);
break;
}
case SPELL_BURNING_HANDS:
case SPELL_COMBUST:
case SPELL_CONTINUAL_FLAME:
case SPELL_DARKFIRE:
case SPELL_DELAYED_BLAST_FIREBALL:
case SPELL_ELEMENTAL_SHIELD:
case SPELL_FIRE_STORM:
case SPELL_FIREBALL:
case SPELL_FIREBRAND:
case SPELL_FLAME_ARROW:
case SPELL_FLAME_LASH:
case SPELL_FLAME_STRIKE:
case SPELL_FLAME_WEAPON:
case SPELL_FLARE:
case SPELL_INCENDIARY_CLOUD:
case SPELL_INFERNO:
case SPELL_SHADES_FIREBALL:
case HGSPELL_FIREBURST:
case HGSPELL_GREATER_ORB_OF_FIRE:
case HGSPELL_LESSER_ORB_OF_FIRE:
case HGSPELL_ORB_OF_FIRE:
FloatingTextStringOnCreature("The water quenches the flames of your spell.", OBJECT_SELF, FALSE);
SetModuleOverrideSpellScriptFinished();
break;
case SPELL_DROWN:
case SPELL_GUST_OF_WIND:
case HGSPELL_DESERT_SIROCCO:
FloatingTextStringOnCreature("This spell doesn't work underwater.", OBJECT_SELF, FALSE);
SetModuleOverrideSpellScriptFinished();
break;
}
}
Some spells and abilities are handled in the individual scripts. Our Wall of Fire spell, for example, has a different effect above level 20, so is handled in the spellscript proper. Other scripts to check include shifter scripts (dragon breath, for example), and summons (fire elementals, and presumably water elementals), which are handled separately for various reasons, some of which may or may not apply to your situation :
hgs_gen_shifter (98): if (GetLocalString(GetArea(si.caster), "Area_SpellHook") == "zwund_spellhook") {
hgs_gen_shifter (149): if (GetLocalString(GetArea(si.caster), "Area_SpellHook") == "zwund_spellhook") {
hgs_gen_shifter (588): if (GetLocalString(GetArea(si.caster), "Area_SpellHook") == "zwund_spellhook") {
nw_s0_newsummon (103): if (GetStringLeft(GetTag(GetArea(si.caster)), 5) == "zwund")
nw_s0_wallfire (59): if (si.clevel < 20 && GetLocalString(oArea, "Area_SpellHook") == "zwund_spellhook") {
x2_s2_discbreath (110): GetLocalString(GetArea(OBJECT_SELF), "Area_SpellHook") == "zwund_spellhook") {
Area-specific spellhooks like this underwater one are checked for at the end of the spellhook proper, with this bit of code:
string sScript = GetLocalString(oArea, "Area_SpellHook");
if (sScript != "")
ExecuteScript(sScript, oCaster);
They follow checks for dead magic zones, amnesia, artifacts, an autocaster, and the like.
Funky
I like this, FUNK, But where I find the "hg_inc", "hg_area_inc","hg_antiex_inc", "fky_environ_inc" and "ac_qstatus_inc"
?