Underwater script systems
#26
Posté 06 juin 2011 - 08:03
#27
Posté 07 juin 2011 - 01:37
Funky, your code affects spells, does it require anything outside of the NWN engine and script functions?
#28
Posté 07 juin 2011 - 02:15
And funkys requires nwnx i would suspect at the least.
#29
Posté 07 juin 2011 - 03:09
Funky
#30
Posté 07 juin 2011 - 03:34
You can add it as well as we did this way;FunkySwerve wrote...
Ours does indeed require nwnx, and linux-only plugin nwnx_structs, but only trivially, not for the core functionality. The bubbles, for example, we set a unique effect id on, to check for it and only apply if not present already (and to strip when leaving watewr). You don't really need the bubble vfx at all - things like this we just use, well, because we can.
Funky
if (iROUND > iHOLD)
{
int iDC = GetLocalInt(oPC,"DC"); // << DC to keep holding breath
if (iCONSave>=iDC)
{
iDC=iDC+1;
SetLocalInt(oPC,"DC",iDC);
SendMessageToPC(oPC,"** You are barely holding your breath **");
FloatingTextStringOnCreature("** blub blub **", oPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_DUR_BUBBLES), oPC);
While not as purdy as scripts of real scripters we tried, lol....it fires off every 6 seconds flying off the PC making the sound and all that.
#31
Posté 07 juin 2011 - 11:40
Modifié par Invisig0th, 07 juin 2011 - 12:54 .
#32
Posté 07 juin 2011 - 11:04
#33
Posté 08 juin 2011 - 12:19
It is not one script but snippets of several scripts you need to add to a module.Artistmonk wrote...
Ok, so yours works as is correct TSM, just add script to module?
You need to do some Spell Hook stuff.
You need to do some OnArea Enter/Exit work.
You need to know how to set variables on areas and/or creatures you do not want to drown.
But yes there is no extra haks or what not and this is an old system as our new is a bit better but that is because I finally am understanding haks and NWNX and the power it gives you to truly mod NWN to something terrificly terrific.
Modifié par TSMDude, 08 juin 2011 - 12:19 .
#34
Posté 08 juin 2011 - 03:27
#35
Posté 11 février 2012 - 03:31
#36
Posté 06 août 2012 - 01:06
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" ????
#37
Posté 07 août 2012 - 11:32
Those are scripts specific to Higher Ground. Funky may be willing to share (nudge, nudge), but HG likes to save the best of the best for themselves and make the rest of us drool.
#38
Posté 12 août 2012 - 03:45
Well, do not cost to try.
Thanks for your help.





Retour en haut







