Add support for NWScript (#5064)
Co-authored-by: Colin Seymour <colin@github.com>
This commit is contained in:
Родитель
0b3814eb19
Коммит
143cd81b3e
|
@ -431,6 +431,7 @@ vendor/grammars/language-eml:
|
|||
vendor/grammars/language-etc:
|
||||
- etc
|
||||
- injections.etc
|
||||
- source.c.nwscript
|
||||
- source.curlrc
|
||||
- source.direct-x
|
||||
- source.dosbox-conf
|
||||
|
|
|
@ -3503,6 +3503,16 @@ NSIS:
|
|||
codemirror_mode: nsis
|
||||
codemirror_mime_type: text/x-nsis
|
||||
language_id: 242
|
||||
NWScript:
|
||||
type: programming
|
||||
color: "#111522"
|
||||
extensions:
|
||||
- ".nss"
|
||||
tm_scope: source.c.nwscript
|
||||
ace_mode: c_cpp
|
||||
codemirror_mode: clike
|
||||
codemirror_mime_type: text/x-csrc
|
||||
language_id: 731233819
|
||||
Nearley:
|
||||
type: programming
|
||||
ace_mode: text
|
||||
|
@ -5640,6 +5650,7 @@ Text:
|
|||
- README.1ST
|
||||
- README.me
|
||||
- README.mysql
|
||||
- README.nss
|
||||
- click.me
|
||||
- delete.me
|
||||
- go.mod
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
//::///////////////////////////////////////////////
|
||||
//:: Filename act_disarmkobold (OnDisarm Trigger script)
|
||||
//:: act_disarmkobold.nss (PC disarms the kobold's tangle trap)
|
||||
//:: Scripted With: Script Editor (Written Manually)
|
||||
//:: Created On: 7/07/2004 5:55:24 PM, by John Gardner
|
||||
//:://////////////////////////////////////////////
|
||||
/*[OnDisarm] Any character seen disarming the trap rigged on the tribe's chest
|
||||
arouse the kobold's anger, who attack the supposed thief breaking into their
|
||||
belongings. Award a 5 XP gain for disarming a very easy trap, and adjust
|
||||
reputation by -100%
|
||||
|
||||
UPDATE July 13th- Kobolds won't attack player if Shaman's been charmed or
|
||||
subject to a "Scare" spell during dialogue.
|
||||
Update 29/07/2004 5:46:41 PM- Fixed an unusual loophole where kobolds attack PC
|
||||
if trap's disarmed at a distance (via "Find Traps"). Kobolds will only attack the
|
||||
player if they see him/her within a certain distance of their belongings (as they
|
||||
won't realize the figure in the distance was the one who caused their trap to
|
||||
be disarmed).*/
|
||||
#include "nw_o2_coninclude"
|
||||
#include "nw_i0_generic"
|
||||
void main()
|
||||
{object oShaman = GetObjectByTag("q9k_shamancrragtail");
|
||||
object oTrappedChest = GetObjectByTag("q9a_strongboxdirty");
|
||||
if (GetDistanceBetween(oTrappedChest, GetLastDisarmed()) < 10.0)
|
||||
{GiveXPToCreature(GetLastDisarmed(), 5);
|
||||
//If Shaman's charmed, he won't be angered by having the PC disarm his trapped chest
|
||||
if (GetLocalInt(oShaman, "Charmed") == 1 || GetLocalInt(oShaman, "Scared") != 1
|
||||
&& GetLocalInt(oShaman, "CrragtailSpokenCharmedLine") != 1)
|
||||
{string szCharmLine = "Yip! You take Crragtail clan's belongings... You be trustworthy friend, yip!";
|
||||
AssignCommand(oShaman, SpeakString(szCharmLine, TALKVOLUME_TALK));
|
||||
SetLocalInt(oShaman, "CrragtailSpokenCharmedLine", 1);}
|
||||
//Similarly, if he's been terrified into submission, he's not going to dare attack the PC
|
||||
else if (GetLocalInt(oShaman, "Charmed") != 1 || GetLocalInt(oShaman, "Scared") == 1
|
||||
&& GetLocalInt(oShaman, "CrragtailSpokenScaredLine") != 1)
|
||||
{string szScareLine = "*whimper* P-please, take shinies, j-just not hurts poor Crragtail... *snivvel*";
|
||||
AssignCommand(oShaman, SpeakString(szScareLine, TALKVOLUME_TALK));
|
||||
SetLocalInt(oShaman, "CrragtailSpokenScaredLine", 1);}
|
||||
//Otherwise, the kobolds aren't going to take kindly to having somebody dismantle their trapwork...
|
||||
else if (GetLocalInt(oShaman, "Charmed") != 1 && GetLocalInt(oShaman, "Scared") != 1)
|
||||
{ShoutDisturbed();
|
||||
AdjustReputation(GetLastDisarmed(), oTrappedChest, -100);
|
||||
object oTribeFaction = GetObjectByTag("q9k_tribehealer");
|
||||
object oKobold = GetFirstFactionMember(oTribeFaction, FALSE);
|
||||
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oKobold, 1);
|
||||
while (GetIsObjectValid(oKobold) == TRUE)
|
||||
{AssignCommand(oKobold, ActionAttack(oPC, FALSE));
|
||||
oKobold = GetNextFactionMember(oKobold, FALSE);}}
|
||||
}}
|
|
@ -0,0 +1,41 @@
|
|||
//::///////////////////////////////////////////////
|
||||
//:: Filename act_unlockkobold (OnUnlocked Placable Script)
|
||||
//:: act_unlockkobold.nss (PC unlocks the Kobold's treasure chest)
|
||||
//:: Scripted With: Script Editor (Written Manually)
|
||||
//:: Created On: 7/07/2004 5:58:52 PM, by John Gardner
|
||||
//:://////////////////////////////////////////////
|
||||
/*[OnUnlock] Should the tribe notice anybody who tries unlocking their treasure
|
||||
chest, they'll promptly attack in rage. Award a minor XP gain, and set a
|
||||
local variable on this chest that ensures this script only awards XP once.
|
||||
|
||||
UPDATE 2/09/2004 5:19:11 PM- Added functions that determine if the last person to
|
||||
unlock the chest was a player-character or not. While this sounds like a pretty useless
|
||||
addition, a player's "Knock" spell isn't considered a player-controlled character's action
|
||||
for the purposes of an OnUnlock script... and the kobolds aren't open-minded enough
|
||||
to realize the faint clicking sounds from their strongbox were the player's magic secretely
|
||||
unlocking it. They *will* however attack anybody who tries pilfering their belongings.*/
|
||||
#include "nw_o2_coninclude"
|
||||
#include "nw_i0_generic"
|
||||
void main()
|
||||
{//Declare major variables
|
||||
object oShaman = GetObjectByTag("q9k_shamancrragtail");
|
||||
object oPC = GetLastUnlocked();
|
||||
object oChest = OBJECT_SELF;
|
||||
//Only award XP if whoever unlocked chest was a PC. This prevents giving XP from casting Knock spells
|
||||
if (GetIsPC(oPC) == TRUE && GetLocalInt(OBJECT_SELF, "HasBeenUnlocked") == 0)
|
||||
{GiveXPToCreature(oPC, 10);
|
||||
SetLocalInt(OBJECT_SELF, "HasBeenUnlocked", 1);}
|
||||
|
||||
if (GetIsPC(oPC) == TRUE && (GetLocalInt(oShaman, "Charmed") != 1 || GetLocalInt(oShaman, "Scared") != 1))
|
||||
{ShoutDisturbed();
|
||||
AdjustReputation(GetLastUnlocked(), OBJECT_SELF, -100);
|
||||
object oTribeFaction = GetObjectByTag("q9k_tribehealer");
|
||||
object oKobold = GetFirstFactionMember(oTribeFaction, FALSE);
|
||||
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oKobold, 1);
|
||||
AssignCommand(oShaman, ClearAllActions(FALSE)); //Kick Crragtail off his throne before fighting
|
||||
while (GetIsObjectValid(oKobold) == TRUE)
|
||||
{AssignCommand(oKobold, ActionAttack(oPC, FALSE));
|
||||
oKobold = GetNextFactionMember(oKobold, FALSE);}
|
||||
AssignCommand(oShaman, RespondToShout(oChest, CLEAR_X0_INC_HENAI_RespondToShout1, oPC));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
//::///////////////////////////////////////////////
|
||||
//:: Filename crawler_death (OnDeath Creature Script)
|
||||
//:: crawler_death.nss (Apply "Freeze Animation" VFX; add custom tokens)
|
||||
//:: Created On: 5/02/2004 4:38:37 PM, by John Gardner
|
||||
//:: Scripted With: Script Editor (Written Manually)
|
||||
//:://////////////////////////////////////////////
|
||||
/*Because the carrion crawler model included in Chaeolwyn's HAK lacked
|
||||
a proper death animation, this script was designed to rectify that
|
||||
problem. The carrion crawler would continue to spasm inexorably,
|
||||
until its corpse was searched and the blood taken. As it seems, I lack
|
||||
any sort of modelling/animation skill, so actually *editing* the MDL file
|
||||
was futile for me, let alone fixing the animation bug.
|
||||
|
||||
UPDATE 5/07/2004 7:36:23 PM- Added a function to set a variable upon
|
||||
Quallo for purpose of conversation, so the line "Move aside so I can kill
|
||||
this crawler, etc..." only shows up if the player *hasn't* killed the
|
||||
carrion crawler.
|
||||
|
||||
UPDATE 3/09/2004 4:24:11 PM- After having come a milestone in my understanding of
|
||||
gmax, I've *just* learned enough to know how to configure animations; so the crawler's
|
||||
dying/dead animations have been fixed to be more appropriate. That means the "Frozen
|
||||
animation" effect is no longer needed (Don't get me wrong, though. I STILL suck bad
|
||||
at modelling... I'm wondering myself how I managed it successfully ^-~;)*/
|
||||
void main()
|
||||
{effect eVFXAnimFreeze = EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION);
|
||||
effect eVFXGreenSlime = EffectVisualEffect(VFX_COM_BLOOD_LRG_GREEN, FALSE);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFXGreenSlime, OBJECT_SELF);
|
||||
AssignCommand(OBJECT_SELF, PlaySound("c_spider_dead"));
|
||||
object oQuallo = GetObjectByTag("x7_quallo");
|
||||
SetLocalInt(oQuallo, "HasPCKilledCrawler", 1);
|
||||
SetCustomToken(398, "knew");
|
||||
SetCustomToken(399, "(he glances remorsefully at the carrion crawler's corpse spawled on the floor).");}
|
|
@ -0,0 +1,15 @@
|
|||
//::///////////////////////////////////////////////
|
||||
//:: Filename e2pc_plaguestack (OnEnter Encounter Script)
|
||||
//:: e2pc_plaguestack.nss (PC encounters the stacked piles of bodies)
|
||||
//:: Scripted with: Script Editor (Written Manually)
|
||||
//:: Created On: 6/07/2004 2:40:13 PM, by John Gardner
|
||||
//::///////////////////////////////////////////////
|
||||
/*[OnEnter Script]: Upon entering the encounter area, send a floating text
|
||||
message to the entering character describing what they see, and set a local
|
||||
variable specifying that the PC's seen the stacked, plague-withered bodies
|
||||
(used in Animal Empathy dialogue with rats/bats).*/
|
||||
void main()
|
||||
{object oPC = GetEnteringObject();
|
||||
if (GetLocalInt(oPC, "HasPCSeenPlaguebodies") != 1)
|
||||
{FloatingTextStringOnCreature("Piles of withered corpses lay sprawled about, each having atrophied from some mysterious epidemic", oPC, FALSE);
|
||||
SetLocalInt(oPC, "HasPCSeenPlaguebodies", 1);}}
|
|
@ -0,0 +1,26 @@
|
|||
//::///////////////////////////////////////////////
|
||||
//:: Filename e3pc_spidersnest (OnEnter Encounter Script)
|
||||
//:: e3pc_spidersnest.nss (PC disturbs Spider's Nest)
|
||||
//:: Initially scripted with: Lilac Soul's NWN Script Generator v1.6
|
||||
//:: Created on 26/3/2004 6:14:33 PM, by John Gardner
|
||||
//::///////////////////////////////////////////////
|
||||
/*When the player disturbs the spider's nest, a brood of three spiders
|
||||
will drop to the floor, accompanied by a non-magical Web effect (as the
|
||||
spiders drop their tangled webbing to immobolise their quarry). Directly
|
||||
before the encounter begins, a brief text message will appear, describing
|
||||
the PC noticing faint movement overhead.
|
||||
|
||||
Note: As the Web-like effect is non-magical, recipients are not permitted
|
||||
Spell resistance checks (although states such as "Freedom of Movement" and
|
||||
Reflex saves apply normally)*/
|
||||
void main()
|
||||
{object oPC = GetEnteringObject();
|
||||
int nOneShot = GetLocalInt(OBJECT_SELF, "q9x_spidernest_active");
|
||||
if (GetLocalInt(OBJECT_SELF, "q9x_spidernest_active") == 1 && GetIsPC(oPC) == TRUE)
|
||||
{object oActionSubject = GetObjectByTag("q9s_spiderweb_trig");
|
||||
effect eAOEWeb = EffectAreaOfEffect(AOE_PER_WEB);
|
||||
effect eSpiderweb = ExtraordinaryEffect(eAOEWeb);
|
||||
location lLocation = GetLocation(GetObjectByTag("q9a_spiderweb_trigger"));
|
||||
SendMessageToPC(oPC, "You briefly notice a vague movement writhing amidst the shadows overhead... before a brood of spiders drop from the rafters!");
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSpiderweb, lLocation, 24.0);
|
||||
SetLocalInt(OBJECT_SELF, "q9x_spidernest_active", 0);}}
|
|
@ -0,0 +1,16 @@
|
|||
//::///////////////////////////////////////////////
|
||||
//:: Filename illusion_spawn (OnSpawn Creature Script)
|
||||
//:: illusion_spawn.nss (Default spawn script for Phantasmal Image)
|
||||
//:: Initially Scripted With: Lilac Soul's NWN Script Generator v1.6
|
||||
//:: Created On: 4/02/2004 09:15:19 AM, by John Gardner
|
||||
//:://///////////////////////////////////////////
|
||||
/*[OnSpawn Script] When spawning in during the cutscene, the Phantasmal
|
||||
Image will appear "kneeling down", so that it appears as if Lilarcor's
|
||||
rising slowly from the sewer's waters. After the PC takes the blade,
|
||||
have the Phantasm removed from the module.*/
|
||||
void main()
|
||||
{//Spawn in using a CutsceneInvisibility effect, removed when Lilarcor reaches the pre-defined waypoint
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), OBJECT_SELF);
|
||||
AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1.0, 2.0));
|
||||
DelayCommand(3.8, DestroyObject(OBJECT_SELF));}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
zlib data compression library
|
||||
|
||||
URL: http://zlib.net/
|
||||
Version: 1.2.5
|
||||
License: zlib License
|
||||
License File: http://zlib.net/zlib_license.html
|
||||
|
||||
Description:
|
||||
|
||||
NSS uses zlib in libSSL (for the DEFLATE compression method), modutil, and
|
||||
signtool.
|
||||
|
||||
Local Modifications:
|
||||
|
||||
- patches/prune-zlib.sh: run this shell script to remove unneeded files
|
||||
from the zlib distribution.
|
||||
- patches/msvc-vsnprintf.patch: define HAVE_VSNPRINTF for Visual C++ 2008
|
||||
(9.0) and later.
|
|
@ -279,6 +279,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
|
|||
- **NEON:** [Alhadis/language-etc](https://github.com/Alhadis/language-etc)
|
||||
- **NPM Config:** [Alhadis/language-etc](https://github.com/Alhadis/language-etc)
|
||||
- **NSIS:** [github-linguist/NSIS](https://github.com/github-linguist/NSIS)
|
||||
- **NWScript:** [Alhadis/language-etc](https://github.com/Alhadis/language-etc)
|
||||
- **Nearley:** [Hardmath123/sublime-nearley](https://github.com/Hardmath123/sublime-nearley)
|
||||
- **Nemerle:** [textmate/nemerle.tmbundle](https://github.com/textmate/nemerle.tmbundle)
|
||||
- **NetLinx:** [amclain/sublime-netlinx](https://github.com/amclain/sublime-netlinx)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 0fde06f5bd2930bec0d1cdb6eabb88b9d42e974a
|
||||
Subproject commit a16dab7666be29f09b585cbba7d2786ed8b17555
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: language-etc
|
||||
version: 0fde06f5bd2930bec0d1cdb6eabb88b9d42e974a
|
||||
version: a16dab7666be29f09b585cbba7d2786ed8b17555
|
||||
type: git_submodule
|
||||
homepage: https://github.com/Alhadis/language-etc
|
||||
license: isc
|
||||
|
|
Загрузка…
Ссылка в новой задаче