Added PRC'd CEP blueprints. Updated CEP1 Merge tlk. Updated CEP2 Merge baseitems.2da.

This commit is contained in:
Jaysyn904 2024-07-22 14:26:37 -04:00
parent 7beb6e4816
commit fc8cfecc2b
4867 changed files with 31697 additions and 55 deletions

File diff suppressed because it is too large Load Diff

View File

@ -211,7 +211,7 @@
207 16967219 stacksmall1 1 1 0x00000 0 0 it_smlmisc 0 1 1 1 it_bag iinvalid_1x1 0 1 0 **** **** **** 0 255 **** **** **** **** 16 0 10 0.01 1726 28 8 0 15 4 **** **** **** **** **** **** 0 0 5448 0 0 1 **** **** 1 **** **** **** **** 0 1 **** **** **** **** **** **** **** **** **** ****
208 16967214 PeltLarge 2 3 0x00000 0 0 it_peltlrg 0 1 1 1 zlc_j33 iinvalid_2x3 0 1 0 **** **** **** 0 255 **** **** **** **** 16 0 1 0.01 16967185 30 8 0 15 4 **** **** **** **** **** **** 0 0 5450 0 0 50 **** **** 1 **** **** **** **** 0 1 **** **** **** **** **** **** **** **** **** ****
209 16967215 PeltThin 1 2 0x00000 0 0 it_peltthn 0 1 1 1 it_bag iinvalid_1x2 0 1 0 **** **** **** 0 255 **** **** **** **** 16 0 1 1 16967185 29 8 0 15 4 **** **** **** **** **** **** 0 0 5474 0 0 5 **** **** 1 **** **** **** **** 0 1 **** **** **** **** **** **** **** **** **** ****
210 16967237 TinySpear 1 4 0x1C030 1 2 WPlSs 0 1 1 1 it_bag iwplss 0 4 1 3 **** 1.2 10 255 1 6 1 3 1 1 1 2 16967238 15 8 0 0 1 46 48 **** **** **** 4 0 0 16967239 0 1 20 17 **** **** **** 35 35 65 76 1 **** **** **** **** **** **** **** **** **** ****
210 16967237 TinySpear 1 4 0x1C030 1 2 WPlSs 0 1 1 1 it_bag iwplss 0 4 1 3 **** 1.2 10 255 1 6 1 3 1 1 1 2 16967238 15 8 0 0 1 46 48 **** **** **** 4 0 0 16967239 0 1 20 17 **** **** **** 35 35 65 76 1 97 627 135 665 59 717 503 924 **** ****
211 16967240 miscsmall3 1 1 0x00000 0 0 it_smlmis3 0 1 1 1 it_bag iinvalid_1x1 0 1 0 **** **** **** 0 255 **** **** **** **** 16 0 1 1 1726 28 8 0 15 4 **** **** **** **** **** **** 0 0 5448 0 0 3 **** **** 1 **** **** **** **** 0 1 **** **** **** **** **** **** **** **** **** ****
212 16967241 miscmedium3 2 2 0x00000 0 0 it_midmis3 0 1 1 1 it_bag iinvalid_2x2 0 1 0 **** **** **** 0 255 **** **** **** **** 16 0 1 1 1726 29 8 0 15 4 **** **** **** **** **** **** 0 0 5449 0 0 5 **** **** 1 **** **** **** **** 0 1 **** **** **** **** **** **** **** **** **** ****
213 16967220 Widget 1 1 0x00000 0 0 it_crpwdgt 0 1 1 1 it_bag iinvalid_1x1 0 1 0 **** **** **** 0 255 **** **** **** **** 16 0 1 0.01 1726 28 8 0 15 4 **** **** **** **** **** **** 0 0 5448 0 0 0 **** **** 1 **** **** **** **** 0 1 **** **** **** **** **** **** **** **** **** ****
@ -320,12 +320,12 @@
316 16807266 falchion_2 2 4 0x1C010 1 2 WxSwFa 0 1 1 1 it_bag iwswfa 0 **** 3 4 **** 1.5 10 255 2 4 3 2 1 36 1 2.09 16807234 9 8 0 0 1 45 **** **** **** **** 4 0 0 16807235 0 1 160 11 **** **** **** 100 100 0 99 1 24606 24618 24630 24642 24654 24666 24678 24690 **** ****
317 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ****
318 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ****
319 16807278 mercurial_longsword 1 4 0x1C030 1 2 WSwLs 0 1 1 1 it_bag iwswls 0 **** 4 3 **** 1.5 10 255 1 8 1 4 1 200 1 2 16807279 9 8 0 0 1 44 **** **** **** **** 4 0 0 16807280 0 1 60 1 **** **** **** 50 50 50 99 1 **** **** **** **** **** **** **** **** **** ****
320 16807281 mercurial_greatsword 2 5 0x1C010 1 2 WSwGs 0 1 1 1 it_bag iwswgs 0 **** 4 4 **** 1.8 10 255 2 6 1 4 1 300 1 2 16807282 9 8 0 0 1 44 **** **** **** **** 4 0 0 16807283 0 1 170 11 **** **** **** 65 65 35 99 1 **** **** **** **** **** **** **** **** **** ****
319 16807278 mercurial_longsword 1 4 0x1C030 1 2 WSwLs 0 1 1 1 it_bag iwswls 0 **** 4 3 **** 1.5 10 255 1 8 1 4 1 200 1 2 16807279 9 8 0 0 1 44 **** **** **** **** 4 0 0 16807280 0 1 60 1 **** **** **** 50 50 50 99 1 106 636 144 674 68 726 512 928 **** ****
320 16807281 mercurial_greatsword 2 5 0x1C010 1 2 WSwGs 0 1 1 1 it_bag iwswgs 0 **** 4 4 **** 1.8 10 255 2 6 1 4 1 300 1 2 16807282 9 8 0 0 1 44 **** **** **** **** 4 0 0 16807283 0 1 170 11 **** **** **** 65 65 35 99 1 97 627 135 665 59 717 503 924 **** ****
321 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ****
322 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ****
323 16807287 windfirewheel 2 2 0x1C030 0 2 WSpWf 0 1 1 1 it_bag iwspwf 0 **** 3 2 **** 1.1 10 255 1 4 2 2 1 2 1 2 16807288 7 8 0 0 1 44 49 **** **** **** 4 0 0 16807289 0 1 10 18 **** **** **** 100 100 0 9 1 **** **** **** **** **** **** **** **** **** ****
324 16807942 maugdoublesword 1 4 0x1C030 1 2 WMaDs 0 1 1 1 it_bag iwdbsw 0 **** 4 3 **** 1.5 10 255 1 8 2 2 1 15 1 2 16807944 9 8 0 0 1 45 **** **** **** **** 4 0 0 16807945 0 1 40 1 **** **** **** 50 50 50 70 1 **** **** **** **** **** **** **** **** **** ****
324 16807942 maugdoublesword 1 4 0x1C030 1 2 WMaDs 0 1 1 1 it_bag iwdbsw 0 **** 4 3 **** 1.5 10 255 1 8 2 2 1 15 1 2 16807944 9 8 0 0 1 45 **** **** **** **** 4 0 0 16807945 0 1 40 1 **** **** **** 50 50 50 70 1 127 655 165 693 89 745 531 943 **** ****
325 16807237 Flowers 1 2 0x1C010 1 2 WFlwr 0 0 0 0 it_bag iwclfr_m_011 0 4 2 3 **** 1.6 10 255 1 6 1 2 8 1 1 1 198 3 8 0 3 4 **** **** **** **** **** 4 0 0 59 50 0 1 **** **** **** **** 50 50 50 10 1 **** **** **** **** **** **** **** **** **** ****
326 16808089 useable_torch 1 3 0x1c030 1 2 hrtorch 0 1 1 1 it_bag ihrtorch 0 **** 2 2 **** 1.1 10 255 **** **** **** **** 1 1 1 0.02 1725 17 8 0 20 4 **** **** **** **** **** **** 0 0 5408 0 1 1 2 **** **** **** 100 100 0 0 1 **** **** **** **** **** **** **** **** **** ****
327 16807240 Flowers_Crystal 1 2 0x1C010 1 2 WClfr 0 1 1 1 it_bag iwclfr_m_011 0 4 2 3 **** 1.6 10 255 1 6 1 2 8 1 1 1 198 1 8 0 3 4 **** **** **** **** **** 4 0 0 59 50 0 5 **** **** **** **** 50 50 50 10 1 **** **** **** **** **** **** **** **** **** ****

View File

@ -0,0 +1,3 @@
cd _tools\
NWN.CLI.exe -k
cd ..

Binary file not shown.

View File

@ -0,0 +1,708 @@
// _on_playerchat
#include "mali_string_fns"
#include "sparky_inc"
#include "dmts_common_inc"
string ShowVector(vector vSomewhere)
{ string sVector = FloatToString(vSomewhere.x, 0, 2) + "x "
+ FloatToString(vSomewhere.y, 0, 2) + "y "
+ FloatToString(vSomewhere.z, 0, 2) + "z";
return sVector;
}
vector StringToVector(string sVector)
{ float fLocX = StringToFloat(FirstWord(sVector, "x"));
sVector = RestWords(sVector, "x");
float fLocY = StringToFloat(FirstWord(sVector, "y"));
sVector = RestWords(sVector, "y");
float fLocZ = StringToFloat(FirstWord(sVector, "z"));
return Vector(fLocX, fLocY, fLocZ);
}
string SparkyList(object oDB, string sListWhat)
{ int iEnc = 1;
string sEnc = "nyah";
string sEncVar;
string sList;
while (sEnc != "")
{ sEncVar = sListWhat + ((iEnc < 10) ? "_0" : "_") + IntToString(iEnc);
sEnc = GetLocalString(oDB, sEncVar);
if (sEnc != "")
{ sList += sEncVar + " = " + sEnc + "\n"; }
iEnc++;
}
if (sList == "")
{ sList = "No matching variables found."; }
return sList;
}
void main()
{
object oPC = GetPCChatSpeaker();
object oArea = GetArea(oPC);
string sChat = GetPCChatMessage();
object oTarget = GetLocalObject(oPC, "DM_Tool_Target");
string sTargetLoc = GetLocalString(oPC, "DM_Tool_TargetLoc");
// If speaker is a possessed NPC, make note of that on the possessing DM
if (GetIsDMPossessed(oPC))
{ SetLocalObject(GetMaster(oPC), "oPossessedNPC", oPC); }
else if (GetIsDM(oPC))
{ DeleteLocalObject(oPC, "oPossessedNPC"); }
// Not a valid command
if (GetStringLeft( sChat, 2) != "@@")
// Send it to the spy network
{ object oPlayer = GetFirstPC();
string sSpyHeard = "(" + GetName(GetArea(oPC)) + ") " + GetName(oPC) + ": " + sChat;
int iIsDM = 0;
object oPossessedNPC;
while (GetIsObjectValid(oPlayer))
{ iIsDM = (GetIsDM(oPlayer));
oPossessedNPC = GetLocalObject(oPlayer, "oPossessedNPC");
if (GetCampaignInt("dmfi", "dmfi_DMSpy", oPlayer) && iIsDM)
{ SendMessageToPC(oPlayer, sSpyHeard);
if (GetMaster(oPossessedNPC) == oPlayer)
{ SendMessageToPC(oPossessedNPC, sSpyHeard); }
}
oPlayer = GetNextPC();
}
return;
}
// It begins with @@, so let's not send it to everyone
SetPCChatMessage();
string sCommand = GetStringLowerCase(FirstWord(GetStringRight(sChat, GetStringLength(sChat) - 2)));
string sParameter = RestWords(sChat);
// PC commands
if (sCommand == "pclist")
{ ExecuteScript("zmal_pcl_list", oPC); return; }
if ((sCommand == "time") && (sParameter == ""))
{ int iHour = GetTimeHour();
int iMin = GetTimeMinute();
int iSec = GetTimeSecond();
string sTime = IntToString(iHour) + ((iMin < 10) ? ":0" : ":")
+ IntToString(iMin) + ((iSec < 10) ? ":0" : ":") + IntToString(iSec);
SendMessageToPC(oPC, "Current time is " + sTime);
return;
}
if ( !(GetIsDM(oPC) || GetIsDMPossessed(oPC)))
{ SendMessageToPC(oPC, "ERROR: Invalid command."); return; }
// DM commands
// Commands that don't require a target
if (sCommand == "help")
{ sParameter = GetStringLowerCase(sParameter);
if (TestStringAgainstPattern("@@**", sParameter))
{ sParameter = RestWords(sParameter, "@@"); }
string sHelp = "Valid commands: @@name, @@tag, @@retag, @@view, @@desc, @@app, @@deity, "
+ "@@shop, @@infinite, @@makeshop, @@copyshop, @@clone, @@dmspy, "
+ "@@copyfrom, @@copyto, @@time, @@location, @@findtag, @@sparky, "
+ "@@scribble, @@editdesc, @@swapdesc";
if (sParameter == "name")
{ sHelp = "@@name NewName: Renames the target.\n"
+ "@@name: With no parameter, resets the name to the original."; }
else if (sParameter == "tag")
{ sHelp = "@@tag: Displays the target's tag."; }
else if (sParameter == "retag")
{ sHelp = "@@retag: Changes the tag of placeables and items."; }
else if (sParameter == "view")
{ sHelp = "@@view: View the target's current description."; }
else if (sParameter == "desc")
{ sHelp = "@@desc NewDesc: Changes the target's description. Use %n for a carriage return.\n"
+ "@@desc: With no parameter, resets the description."; }
else if (sParameter == "app")
{ sHelp = "@@app: Displays the target's appearance number.\n"
+ "@@app AppNumber: Change the target's appearance."; }
else if (sParameter == "deity")
{ sHelp = "@@deity: Display the target's deity.\n"
+ "@@deity NewDeity: Change the target's deity."; }
else if (sParameter == "time")
{ sHelp = "@@time: Displays the current time.\n"
+ "@@time hour:min:sec : Sets the current time."; }
else if (sParameter == "dmspy")
{ sHelp = "@@dmspy: Toggles the status of the DM Spy Network, which "
+ "reports anything said anywhere on the server."; }
else if (sParameter == "clone")
{ sHelp = "@@clone Copies: Makes the specified number of copies of the target."
+ " Copies defaults to 1."; }
else if (sParameter == "copyfrom")
{ sHelp = "@@copyfrom: Copies items from the first container you "
+ " target to the second container you target."; }
else if (sParameter == "copyto")
{ sHelp = "@@copyto: Copies items from the second container you "
+ " target to the first container you target."; }
else if (sParameter == "makeshop")
{ sHelp = "@@makeshop: Opens a new store for the target NPC."
+ " Must already be set up with a merchant conversation.\n"
+ "@@makeshop ShopTag: Attempts to set up a shop for the targeted"
+ " NPC with the specified ShopTag. Use with stores on the pallete.\n"
+ "(shop commands only work if the shop has a tag of the form Shop_NPCtag)"; }
else if (sParameter == "copyshop")
{ sHelp = "@@copyshop: Copy the target NPC's shop to your current location.\n"
+ "@@copyshop NewTag: Copy the target NPC's shop, and change "
+ "its tag to NewTag.\n"
+ "(shop commands only work if the shop has a tag of the form Shop_NPCtag)"; }
else if (sParameter == "shop")
{ sHelp = "@@shop: Open the target NPC's store.\n"
+ "(shop commands only work if the shop has a tag of the form Shop_NPCtag)"; }
else if (sParameter == "infinite")
{ sHelp = "@@infinite: Sets a shop item to an infinite supply."; }
else if (sParameter == "finite")
{ sHelp = "@@finite: Sets a shop item to a finite supply."; }
else if (sParameter == "sparky")
{ sHelp = "@@sparky despawn: Removes all Sparky spawns from the area.\n"
+ "@@sparky force despawn: If the spawn script was aborted, or"
+ " creatures were spawned from the DM Encounter Spawn widget,"
+ " this command should despawn them when @@sparky despawn cannot.\n"
+ "@@sparky spawn: Removes any current Sparky spawns, and after a 2"
+ " second delay, forces the spawns to activate.\n"
+ "@@sparky list encounters: Lists the encounter variables on the current area.\n"
+ "@@sparky list table TableName: Lists the specified table.\n"
+ "@@sparky list group GroupName: Lists the specified group."
+ "After targeting a Sparky Spawn trigger, you may use these commands:\n"
+ "@@sparky trigger spawn: Removes any current Sparky spawns, and after a 2"
+ " second delay, forces the spawns on the trigger to activate.\n"
+ "@@sparky trigger list encounters: Lists the encounter variables on the trigger.\n"
+ "@@sparky trigger list table TableName: Lists the specified table.\n"
+ "@@sparky trigger list group GroupName: Lists the specified group."; }
else if (sParameter == "location")
{ sHelp = "@@location: Shows your current coordinates and facing."; }
else if (sParameter == "findtag")
{ sHelp = "@@findtag Tag: Displays the location (area and coordinates) of"
+ " all objects with the tag Tag. If the object is on a creature"
+ " or in a container, the name of the creature/container will be"
+ " displayed as well."; }
else if (sParameter == "scribble")
{ sHelp = "@@scribble Message: Writes the specified message on the floor "
+ "at the targeted location. A stage manager widget is provided, "
+ "ready to be boxed up."; }
else if (sParameter == "editdesc")
{ sHelp = "@@editdesc Delimiter SearchFor<Delimiter>ReplaceWith\n"
+ "Replaces all occurances of SearchFor with ReplaceWith in target's"
+ " description."; }
else if (sParameter == "swapdesc")
{ sHelp = "@@swapdesc\nSwaps the identified and unidentified descriptions of the target."; }
SendMessageToPC(oPC, sHelp);
return;
}
if (sCommand == "location")
{ SendMessageToPC(oPC, "Your location is: " + ShowVector(GetPosition(oPC))
+ ", facing " + FloatToString(GetFacing(oPC), 0,0));
return;
}
if (sCommand == "findtag")
{ object oFindee = oPC;
object oPossessor = oPC;
string sFindeeLocs = "";
int iLoop = 0;
while (GetIsObjectValid(oFindee))
{ oFindee = GetObjectByTag(sParameter, iLoop);
if (GetIsObjectValid(oFindee))
{ oPossessor = GetItemPossessor(oFindee);
if (GetIsObjectValid(oPossessor))
{ sFindeeLocs += "\n" + GetName(GetArea(oPossessor)) + ": "
+ ShowVector(GetPosition(oPossessor)) + " on "
+ GetName(oPossessor);
}
else
{ sFindeeLocs += "\n" + GetName(GetArea(oFindee)) + ": "
+ ShowVector(GetPosition(oFindee));
}
iLoop++;
}
}
if (iLoop = 0)
{ SendMessageToPC(oPC, "Nothing found."); }
else
{ SendMessageToPC(oPC, "Locations for tag " + sParameter + ":" + sFindeeLocs); }
return;
}
if (sCommand == "dmspy")
{ int iDMSpy = GetCampaignInt("dmfi", "dmfi_DMSpy", oPC);
int iToggle = abs(iDMSpy - 1);
SetCampaignInt("dmfi", "dmfi_DMSpy", iToggle, oPC);
string sStatus = iToggle ? "on" : "off";
SendMessageToPC(oPC, "DM Spy network " + sStatus + ".");
return;
}
if (sCommand == "time")
{ if (sParameter != "")
{ if (TestStringAgainstPattern("*n:*n:*n", sParameter))
{ int iHour = StringToInt(FirstWord(sParameter, ":"));
sParameter = RestWords(sParameter, ":");
int iMin = StringToInt(FirstWord(sParameter, ":"));
sParameter = RestWords(sParameter, ":");
int iSec = StringToInt(FirstWord(sParameter, ":"));
sParameter = RestWords(sParameter, ":");
SetTime(iHour, iMin, iSec, 0);
}
else
{ SendMessageToPC(oPC, "ERROR: Invalid time format."); return; }
}
int iHour = GetTimeHour();
int iMin = GetTimeMinute();
int iSec = GetTimeSecond();
string sTime = IntToString(iHour) + ((iMin < 10) ? ":0" : ":")
+ IntToString(iMin) + ((iSec < 10) ? ":0" : ":") + IntToString(iSec);
SendMessageToPC(oPC, "Current time is " + sTime);
return;
}
if (sCommand == "sparky")
{ sParameter = GetStringLowerCase(sParameter);
if (sParameter == "despawn")
{ SendMessageToPC(oPC, "Despawning...");
Despawn(oArea);
return;
}
if (sParameter == "force despawn")
{ SendMessageToPC(oPC, "Forcing a despawn...");
SetLocalInt(oArea, "iSparkySpawned", TRUE);
Despawn(oArea);
return;
}
object oDB = oArea;
if (FirstWord(sParameter) == "trigger")
{ if ( !( (GetObjectType(oTarget) == OBJECT_TYPE_TRIGGER) && (GetLocalInt(oTarget, "iSparkyTrigger")) ))
{ SendMessageToPC(oPC, "ERROR: Target is not a Sparky Spawn trigger!"); return; }
sParameter = RestWords(sParameter);
oDB = oTarget;
}
if ((sParameter == "respawn") || (sParameter == "spawn"))
{ SendMessageToPC(oPC, "Spawning...");
Despawn(oArea);
DelayCommand(2.0f, SpawnEncounters(oDB));
return;
}
if (FirstWord(sParameter) == "list")
{ sParameter = RestWords(sParameter);
string sListWhat = FirstWord(sParameter);
sParameter = FirstWord(RestWords(sParameter));
if (sListWhat == "encounters")
{ SendMessageToPC(oPC, SparkyList(oDB, "encounter")); return; }
if ((sListWhat != "table") && (sListWhat != "group"))
{ SendMessageToPC(oPC, "ERROR: Invalid Sparky list command."); return; }
if (sParameter == "")
{ SendMessageToPC(oPC, "ERROR: No " + GetStringLowerCase(sListWhat) + " name supplied."); return; }
SendMessageToPC(oPC, SparkyList(oDB, GetStringLowerCase(sListWhat + "_" + sParameter)));
return;
}
SendMessageToPC(oPC, "ERROR: Invalid Sparky command."); return;
}
if (sCommand == "areavar")
{ string sVarType = GetStringLowerCase(FirstWord(sParameter));
string sParameter2 = RestWords(sParameter);
string sVarName = FirstWord(sParameter2);
sParameter2 = RestWords(sParameter2);
if (sVarName == "")
{ SendMessageToPC(oPC, "ERROR: No variable name supplied."); return; }
if (sVarType == "int")
{ int iValue = StringToInt(sParameter2);
SetLocalInt(oArea, sVarName, iValue);
SendMessageToPC(oPC, "Variable " + sVarName + " set to: " + IntToString(iValue));
return;
}
if (sVarType == "float")
{ float fValue = StringToFloat(sParameter2);
SetLocalFloat(oArea, sVarName, fValue);
SendMessageToPC(oPC, "Variable " + sVarName + " set to: " + FloatToString(fValue));
return;
}
if (sVarType == "string")
{ SetLocalString(oArea, sVarName, sParameter2);
SendMessageToPC(oPC, "Variable " + sVarName + " set to: " + sParameter2);
return;
}
}
if ((sCommand == "scribble") || (sCommand == "scribblewall"))
{ if (sTargetLoc == "")
{ SendMessageToPC(oPC, "ERROR: Target a location first!"); return; }
vector vStart = StringToVector(sTargetLoc);
float fTheta = GetTheta(GetPosition(oPC), vStart);
location lStartLoc = Location(oArea, vStart, fTheta);
if (sParameter == "")
{ object oMarker = GetObjectByTag("ScribbleMarker_" + ObjectToString(oPC));
if (GetIsObjectValid(oMarker))
{ DestroyObject(oMarker);
SendMessageToPC(oPC, "Marker removed.");
}
else
{ SendMessageToPC(oPC, "Creating marker...");
oMarker = CreateObject(OBJECT_TYPE_PLACEABLE, "zep_os_sar_001", lStartLoc, FALSE, "ScribbleMarker_" + ObjectToString(oPC));
if (sCommand == "scribblewall")
{ SetLocalInt(oMarker, "iPlayAnimation", ANIMATION_PLACEABLE_CLOSE);
ExecuteScript("playanimation", oMarker);
}
}
return;
}
string sAlphabet_LC = "abcdefghijklmnopqrstuvwxyz";
string sAlphabet_UC = GetStringUpperCase(sAlphabet_LC);
string sNumbers = "0123456789";
string sSpecial = ".,-";
string sSpecialTag = "pdcmds";
string sLetter;
int iPlayAnimation = 0;
object oMarker = GetObjectByTag("ScribbleMarker_" + ObjectToString(oPC));
if (GetIsObjectValid(oMarker))
{ lStartLoc = GetLocation(oMarker);
iPlayAnimation = GetLocalInt(oMarker, "iPlayAnimation");
fTheta = GetFacing(oMarker);
DestroyObject(oMarker);
}
else
{ SendMessageToPC(oPC, "WARNING: Marker not found. Using target location..."); }
location lLoc = lStartLoc;
object oSM_widget = CreateItemOnObject("mali_dm_stage", oPC);
if (!GetIsObjectValid(oSM_widget))
{ SendMessageToPC(oPC, "Warning: Could not create a stage manager widget..."); }
object oLetter;
int iLoop;
for (iLoop = 0; iLoop < GetStringLength(sParameter); iLoop++)
{ sLetter = GetSubString(sParameter, iLoop, 1);
if (FindSubString(sAlphabet_LC + sNumbers, sLetter) != -1)
{ oLetter = CreateObject(OBJECT_TYPE_PLACEABLE, "zep_os_sn" + sLetter + "_001", lLoc);
if (iPlayAnimation)
{ SetLocalInt(oLetter, "iPlayAnimation", iPlayAnimation);
ExecuteScript("playanimation", oLetter);
}
lLoc = Location(oArea, GetChangedPosition(GetPositionFromLocation(lLoc), 0.25f, fTheta - 90.0f), fTheta);
if (GetIsObjectValid(oSM_widget))
{ SetLocalObject(oSM_widget, "oProp" + IntToString(iLoop + 1), oLetter);
SetLocalInt(oSM_widget, "iProp" + ObjectToString(oLetter), iLoop + 1);
SetLocalInt(oSM_widget, "iPropIndex", iLoop + 1);
}
}
else if (FindSubString(sAlphabet_UC, sLetter) != -1)
{ oLetter = CreateObject(OBJECT_TYPE_PLACEABLE, "zep_os_sn" + GetStringLowerCase(sLetter) + "_002", lLoc);
if (iPlayAnimation)
{ SetLocalInt(oLetter, "iPlayAnimation", iPlayAnimation);
ExecuteScript("playanimation", oLetter);
}
lLoc = Location(oArea, GetChangedPosition(GetPositionFromLocation(lLoc), 0.25f, fTheta - 90.0f), fTheta);
if (GetIsObjectValid(oSM_widget))
{ SetLocalObject(oSM_widget, "oProp" + IntToString(iLoop + 1), oLetter);
SetLocalInt(oSM_widget, "iProp" + ObjectToString(oLetter), iLoop + 1);
SetLocalInt(oSM_widget, "iPropIndex", iLoop + 1);
}
}
else if (FindSubString(sSpecial, sLetter) != -1)
{ oLetter = CreateObject(OBJECT_TYPE_PLACEABLE, "zep_os_s" + GetSubString(sSpecialTag, FindSubString(sSpecial, sLetter) * 2, 2) + "_001", lLoc);
if (iPlayAnimation)
{ SetLocalInt(oLetter, "iPlayAnimation", iPlayAnimation);
ExecuteScript("playanimation", oLetter);
}
lLoc = Location(oArea, GetChangedPosition(GetPositionFromLocation(lLoc), 0.25f, fTheta - 90.0f), fTheta);
if (GetIsObjectValid(oSM_widget))
{ SetLocalObject(oSM_widget, "oProp" + IntToString(iLoop + 1), oLetter);
SetLocalInt(oSM_widget, "iProp" + ObjectToString(oLetter), iLoop + 1);
SetLocalInt(oSM_widget, "iPropIndex", iLoop + 1);
}
}
else
{ lLoc = Location(oArea, GetChangedPosition(GetPositionFromLocation(lLoc), 0.5f, fTheta - 90.0f), fTheta); }
}
if (GetIsObjectValid(oSM_widget))
{ SetName(oSM_widget, "The Moving Finger");
SetDescription(oSM_widget, "Use this stage manager widget to enscribe the following message on the floor:\n\n" + sParameter);
}
return;
}
// Commands that require a target
if (!GetIsObjectValid(oTarget))
{ SendMessageToPC(oPC, "ERROR: Invalid target!"); return; }
string sTargetName = GetName(oTarget);
if (sCommand == "setstring")
{ string sVarName = FirstWord(sParameter);
sParameter = RestWords(sParameter);
if (sParameter == "")
{ SendMessageToPC(oPC, "ERROR: No variable name supplied!"); return; }
SetLocalString(oTarget, sVarName, sParameter);
SendMessageToPC(oPC, "Set.");
return;
}
if (sCommand == "areavar")
{ string sVarType = GetStringLowerCase(FirstWord(sParameter));
string sParameter2 = RestWords(sParameter);
string sVarName = FirstWord(sParameter2);
if (sVarType != "object")
{ SendMessageToPC(oPC, "ERROR: Invalid variable type."); return; }
SetLocalObject(oArea, sVarName, oTarget);
SendMessageToPC(oPC, "Variable " + sVarName + " set to: " + sTargetName);
return;
}
if (sCommand == "name")
{ if( GetIsDM(oTarget) || GetIsPC(oTarget))
{ SendMessageToPC(oPC, "ERROR: You can't rename a PC or DM."); return; }
else
{ SetName(oTarget, sParameter);
SendMessageToPC(oPC, sTargetName + "'s name set to: " + GetName(oTarget));
return;
}
}
if (sCommand == "view")
{ SendMessageToPC(oPC, sTargetName + "'s Description:\n" + GetDescription(oTarget)); return; }
if (sCommand == "desc")
{ SetDescription(oTarget, SearchAndReplace(sParameter, "%n", "\n")); return; }
if (sCommand == "editdesc")
{ string sDesc = GetDescription(oTarget);
string sDelimiter = FirstWord(sParameter);
sParameter = RestWords(sParameter);
string sSearch = FirstWord(sParameter, sDelimiter);
string sReplace = RestWords(sParameter, sDelimiter);
SetDescription(oTarget, SearchAndReplace(sDesc, sSearch, sReplace));
return;
}
if (sCommand == "swapdesc")
{ string sDesc = GetDescription(oTarget);
SetDescription(oTarget, GetDescription(oTarget, FALSE, FALSE));
SetDescription(oTarget, sDesc, FALSE);
return;
}
if (sCommand == "app")
{ int iApp = StringToInt(sParameter);
if (GetObjectType(oTarget) != OBJECT_TYPE_CREATURE)
{ SendMessageToPC(oPC, "ERROR: Invalid target. NPCs, players, or DMs only."); return; }
if (sParameter == "")
{ SendMessageToPC(oPC, sTargetName + "'s appearance: " + IntToString(GetAppearanceType(oTarget))); return; }
if ( ((sParameter != "0") && (iApp == 0)) || (iApp < 0) )
{ SendMessageToPC(oPC, "ERROR: Appearance must be a non-negative integer!"); return; }
SetCreatureAppearanceType(oTarget, iApp); return;
}
if (sCommand == "deity")
{ if (GetObjectType(oTarget) != OBJECT_TYPE_CREATURE)
{ SendMessageToPC(oPC, "ERROR: Invalid target."); return; }
if (sParameter == "")
{ SendMessageToPC(oPC, sTargetName + "'s deity: " + GetDeity(oTarget)); return; }
else
{ SetDeity(oTarget, sParameter);
SendMessageToPC(oPC, sTargetName + "'s deity set to: " + GetDeity(oTarget));
return;
}
}
if (sCommand == "tag")
{ SendMessageToPC(oPC, sTargetName + "'s tag: " + GetTag(oTarget)); return; }
if (sCommand == "retag")
{ if (GetObjectType(oTarget) == OBJECT_TYPE_PLACEABLE)
{ location lTargetLocation = GetLocation(oTarget);
oTarget = RecreateObjectAtLocation(oTarget, lTargetLocation, sParameter);
SetLocalInt(oTarget, "iRetagged", TRUE);
SetLocalObject(oPC, "DM_Tool_Target", oTarget);
SendMessageToPC(oPC, sTargetName + "'s tag is now: " + GetTag(oTarget));
return;
}
else if (GetObjectType(oTarget) == OBJECT_TYPE_ITEM)
{ object oNewItem = CopyObject(oTarget, GetLocation(oPC), oPC, sParameter);
if (GetIsObjectValid(oNewItem))
{ DestroyObject(oTarget);
SendMessageToPC(oPC, sTargetName + "'s tag is now: " + GetTag(oNewItem));
SetLocalObject(oPC, "DM_Tool_Target", oNewItem);
return; }
else
{ SendMessageToPC(oPC, "ERROR: Item not retagged. Reason unknown."); return; }
}
else
{ SendMessageToPC(oPC, "ERROR: Only placeables and items may be retagged."); return; }
}
if (sCommand == "shop")
{ if (GetObjectType(oTarget) == OBJECT_TYPE_STORE)
{ OpenStore(oTarget, oPC); return; }
if (GetIsPC(oTarget) || !(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE))
{ SendMessageToPC(oPC, "ERROR: Not an NPC!"); return; }
object oStore = GetNearestObjectByTag("Store_" + GetTag(oTarget), oTarget);
if (!GetIsObjectValid(oStore) || (GetObjectType(oStore) != OBJECT_TYPE_STORE))
{ SendMessageToPC(oPC, "ERROR: Could not find store!"); return; }
else
{ OpenStore(oStore, oPC); return; }
}
if (sCommand == "infinite")
{ if (GetObjectType(oTarget) != OBJECT_TYPE_ITEM)
{ SendMessageToPC(oPC, "ERROR: Must target an item!"); return; }
else if (GetObjectType(GetItemPossessor(oTarget)) != OBJECT_TYPE_STORE)
{ SendMessageToPC(oPC, "ERROR: Must target an item in a store!"); return; }
else
{ SetInfiniteFlag(oTarget);
SendMessageToPC(oPC, sTargetName + " is now set infinite."); return; }
}
if (sCommand == "finite")
{ if (GetObjectType(oTarget) != OBJECT_TYPE_ITEM)
{ SendMessageToPC(oPC, "ERROR: Must target an item!"); return; }
else if (GetObjectType(GetItemPossessor(oTarget)) != OBJECT_TYPE_STORE)
{ SendMessageToPC(oPC, "ERROR: Must target an item in a store!"); return; }
else
{ SetInfiniteFlag(oTarget, FALSE);
SendMessageToPC(oPC, sTargetName + " is now set finite."); return; }
}
if (sCommand == "makeshop")
{ if (GetIsPC(oTarget) || !(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE))
{ SendMessageToPC(oPC, "ERROR: Not an NPC!"); return; }
string sStoreTag = "Store_" + GetTag(oTarget);
string sStoreResRef = sStoreTag;
if (sParameter != "")
{ sStoreResRef = sParameter; }
object oStore = CreateObject(OBJECT_TYPE_STORE, sStoreResRef, GetLocation(oPC), FALSE, sStoreTag);
if (!GetIsObjectValid(oStore))
{ oStore = CreateObject(OBJECT_TYPE_STORE, "Empty_Store", GetLocation(oPC), FALSE, sStoreTag); }
if (GetIsObjectValid(oStore))
{ SetLocalObject(oPC, "DM_Tool_Target", oStore);
SendMessageToPC(oPC, "New target: " + GetName(oStore) + "\nTag: " + GetTag(oStore));
return;
}
else
{ SendMessageToPC(oPC, "ERROR: Store not created. Reason unknown."); return; }
}
if (sCommand == "copyshop")
{ if (GetIsPC(oTarget) || !(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE))
{ SendMessageToPC(oPC, "ERROR: Not an NPC!"); return; }
object oStore = GetNearestObjectByTag("Store_" + GetTag(oTarget), oTarget);
if (!GetIsObjectValid(oStore) || (GetObjectType(oStore) != OBJECT_TYPE_STORE))
{ SendMessageToPC(oPC, "ERROR: Could not find store!"); return; }
string sStoreName = GetName(oStore);
string sStoreTag = GetTag(oStore);
if (!(sParameter == ""))
{ sStoreTag = sParameter; }
object oNewStore = CreateObject(OBJECT_TYPE_STORE, "Empty_Store", GetLocation(oPC), FALSE, sStoreTag);
if (GetIsObjectValid(oNewStore))
{ object oMerchandise = GetFirstItemInInventory(oStore);
while (GetIsObjectValid(oMerchandise))
{ if (GetInfiniteFlag(oMerchandise))
{ CopyItem(oMerchandise, oNewStore, TRUE); }
oMerchandise = GetNextItemInInventory(oStore);
}
SetName(oNewStore, sStoreName);
SetLocalObject(oPC, "DM_Tool_Target", oNewStore);
SendMessageToPC(oPC, "New target: " + GetName(oNewStore) + "\nTag: " + GetTag(oNewStore));
return;
}
else
{ SendMessageToPC(oPC, "ERROR: Store not created. Reason unknown."); return; }
}
if (sCommand == "clone")
{ if ( !((GetObjectType(oTarget) == OBJECT_TYPE_ITEM) || (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)))
{ SendMessageToPC(oPC, "ERROR: You may only clone items and creatures."); return; }
int iCopies = StringToInt(sParameter);
if (sParameter == "")
{ iCopies = 1; }
if (iCopies < 1)
{ SendMessageToPC(oPC, "ERROR: Number of copies must be an integer greater than zero!"); return; }
int iLoop = 0;
while (iLoop < iCopies)
{ if (GetObjectType(oTarget) == OBJECT_TYPE_ITEM)
{ CopyObject(oTarget, GetLocation(oPC), oPC); }
else
{ CopyObject(oTarget, GetLocation(oTarget)); }
iLoop++;
}
return;
}
if ((sCommand == "copyfrom") || (sCommand == "copyto"))
{ object oSource;
object oDest;
object oThingie;
if (sCommand == "copyfrom")
{ oSource = GetLocalObject(oPC, "oDM_Bag1");
oDest = GetLocalObject(oPC, "oDM_Bag2");
}
else
{ oSource = GetLocalObject(oPC, "oDM_Bag2");
oDest = GetLocalObject(oPC, "oDM_Bag1");
}
if (!GetIsObjectValid(oSource) || !GetIsObjectValid(oDest))
{ SendMessageToPC(oPC, "ERROR: Invalid target. Re-target both containers."); return; }
if (!GetHasInventory(oSource) || !GetHasInventory(oDest))
{ SendMessageToPC(oPC, "ERROR: Command may only be used with containers."); return; }
CopyContents(oSource, oDest, sParameter);
return;
}
// Doesn't match anything
SendMessageToPC(oPC, "ERROR: Invalid command.");
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,26 @@
/* Script generated by
Lilac Soul's NWN Script Generator, v. 1.2
For download info, please visit:
http://www.angelfire.com/space/lilacsoul */
//Put this OnEnter
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
object oTarget;
object oSpawn;
oTarget = GetWaypointByTag("here");
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_boulder", GetLocation(oTarget));
oTarget = oSpawn;
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_BREACH), GetLocation(oTarget));
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,14 @@
2DA V2.0
LABEL MAX
0 **** ****
1 appearance 3999
2 portraits 3829
3 tailmodel 4999
4 visualeffects 7167
5 wingmodel 1999
6 **** ****
7 **** ****
8 **** ****
9 **** ****
10 **** ****

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,566 @@
/*
* colors_inc.nss
*
* Access to the color tokens provided by The Krit.
************************************************************
* Please use these judiciously to enhance the gaming
* experience. (Overuse of colors detracts from it.)
************************************************************
* Color tokens in a string will change the color from that
* point on when the string is displayed on the screen.
* Every color change should be ended by an end token,
* supplied by ColorTokenEnd().
************************************************************/
///////////////////////////////////////////////////////////////////////////////
// Constants
///////////////////////////////////////////////////////////////////////////////
const string ColorArray = "  !##$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]]^_`abcdefghijklmnopqrstuvwxyz{|}~<7F>ƒ„…†‡ˆ‰ŠŒ<E280B9>Ž<EFBFBD><C5BD>“”•˜™šœ<E280BA>žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþþ";
///////////////////////////////////////////////////////////////////////////////
// Prototypes
///////////////////////////////////////////////////////////////////////////////
// Supplies a string that changes the text to the given RGB values.
// Valid parameter values are 0-255.
string ColorToken(int nRed, int nGreen, int nBlue);
// Supplies a string that ends an earlier color change.
string ColorTokenEnd();
///////////////////////////////////////////////////////////////////////////////
// Supplies a string that changes the text to black.
string ColorTokenBlack();
// Supplies a string that changes the text to blue.
string ColorTokenBlue();
// Supplies a string that changes the text to gray.
string ColorTokenGray();
// Supplies a string that changes the text to green.
string ColorTokenGreen();
// Supplies a string that changes the text to light purple.
string ColorTokenLightPurple();
// Supplies a string that changes the text to orange.
string ColorTokenOrange();
// Supplies a string that changes the text to pink.
string ColorTokenPink();
// Supplies a string that changes the text to purple.
string ColorTokenPurple();
// Supplies a string that changes the text to red.
string ColorTokenRed();
// Supplies a string that changes the text to white.
string ColorTokenWhite();
// Supplies a string that changes the text to yellow.
string ColorTokenYellow();
///////////////////////////////////////////////////////////////////////////////
// Supplies a string that changes the text to the color of
// combat messages.
string ColorTokenCombat();
// Supplies a string that changes the text to the color of
// dialog.
string ColorTokenDialog();
// Supplies a string that changes the text to the color of
// dialog actions.
string ColorTokenDialogAction();
// Supplies a string that changes the text to the color of
// dialog checks.
string ColorTokenDialogCheck();
// Supplies a string that changes the text to the color of
// dialog highlighting.
string ColorTokenDialogHighlight();
// Supplies a string that changes the text to the color of
// replies in the dialog window.
string ColorTokenDialogReply();
// Supplies a string that changes the text to the color of
// the DM channel.
string ColorTokenDM();
// Supplies a string that changes the text to the color of
// many game engine messages.
string ColorTokenGameEngine();
// Supplies a string that changes the text to the color of
// saving throw messages.
string ColorTokenSavingThrow();
// Supplies a string that changes the text to the color of
// messages sent from scripts.
string ColorTokenScript();
// Supplies a string that changes the text to the color of
// server messages.
string ColorTokenServer();
// Supplies a string that changes the text to the color of
// shouts.
string ColorTokenShout();
// Supplies a string that changes the text to the color of
// skill check messages.
string ColorTokenSkillCheck();
// Supplies a string that changes the text to the color of
// the talk and party talk channels.
string ColorTokenTalk();
// Supplies a string that changes the text to the color of
// tells.
string ColorTokenTell();
// Supplies a string that changes the text to the color of
// whispers.
string ColorTokenWhisper();
///////////////////////////////////////////////////////////////////////////////
// Returns the name of oPC, surrounded by color tokens, so the color of
// the name is the lighter blue often used in NWN game engine messages.
string GetNamePCColor(object oPC);
// Returns the name of oNPC, surrounded by color tokens, so the color of
// the name is the shade of purple often used in NWN game engine messages.
string GetNameNPCColor(object oNPC);
///////////////////////////////////////////////////////////////////////////////
// Basic Functions
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// ColorToken()
//
// Supplies a string that changes the text to the given RGB values.
// Valid parameter values are 0-255.
//
string ColorToken(int nRed, int nGreen, int nBlue)
{
return "<c" + GetSubString(ColorArray, nRed, 1) +
GetSubString(ColorArray, nGreen, 1) +
GetSubString(ColorArray, nBlue, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenEnd()
//
// Supplies a string that ends an earlier color change.
//
string ColorTokenEnd()
{
return "</c>";
}
///////////////////////////////////////////////////////////////////////////////
// Functions by Color
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// ColorTokenBlack()
//
// Supplies a string that changes the text to black.
//
string ColorTokenBlack()
{
return "<c" + GetSubString(ColorArray, 0, 1) +
GetSubString(ColorArray, 0, 1) +
GetSubString(ColorArray, 0, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenBlue()
//
// Supplies a string that changes the text to blue.
//
string ColorTokenBlue()
{
return "<c" + GetSubString(ColorArray, 0, 1) +
GetSubString(ColorArray, 0, 1) +
GetSubString(ColorArray, 255, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenGray()
//
// Supplies a string that changes the text to gray.
//
string ColorTokenGray()
{
return "<c" + GetSubString(ColorArray, 127, 1) +
GetSubString(ColorArray, 127, 1) +
GetSubString(ColorArray, 127, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenGreen()
//
// Supplies a string that changes the text to green.
//
string ColorTokenGreen()
{
return "<c" + GetSubString(ColorArray, 0, 1) +
GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 0, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenLightPurple()
//
// Supplies a string that changes the text to light purple.
//
string ColorTokenLightPurple()
{
return "<c" + GetSubString(ColorArray, 175, 1) +
GetSubString(ColorArray, 48, 1) +
GetSubString(ColorArray, 255, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenOrange()
//
// Supplies a string that changes the text to orange.
//
string ColorTokenOrange()
{
return "<c" + GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 127, 1) +
GetSubString(ColorArray, 0, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenPink()
//
// Supplies a string that changes the text to pink.
//
string ColorTokenPink()
{
return "<c" + GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 0, 1) +
GetSubString(ColorArray, 255, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenPurple()
//
// Supplies a string that changes the text to purple.
//
string ColorTokenPurple()
{
return "<c" + GetSubString(ColorArray, 127, 1) +
GetSubString(ColorArray, 0, 1) +
GetSubString(ColorArray, 255, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenRed()
//
// Supplies a string that changes the text to red.
//
string ColorTokenRed()
{
return "<c" + GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 0, 1) +
GetSubString(ColorArray, 0, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenWhite()
//
// Supplies a string that changes the text to white.
//
string ColorTokenWhite()
{
return "<c" + GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 255, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenYellow()
//
// Supplies a string that changes the text to yellow.
//
string ColorTokenYellow()
{
return "<c" + GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 0, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// Functions by Purpose
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// ColorTokenCombat()
//
// Supplies a string that changes the text to the color of
// combat messages.
//
string ColorTokenCombat()
{
return "<c" + GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 102, 1) +
GetSubString(ColorArray, 0, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenDialog()
//
// Supplies a string that changes the text to the color of
// dialog.
//
string ColorTokenDialog()
{
return "<c" + GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 255, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenDialogAction()
//
// Supplies a string that changes the text to the color of
// dialog actions.
//
string ColorTokenDialogAction()
{
return "<c" + GetSubString(ColorArray, 1, 1) +
GetSubString(ColorArray, 254, 1) +
GetSubString(ColorArray, 1, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenDialogCheck()
//
// Supplies a string that changes the text to the color of
// dialog checks.
//
string ColorTokenDialogCheck()
{
return "<c" + GetSubString(ColorArray, 254, 1) +
GetSubString(ColorArray, 1, 1) +
GetSubString(ColorArray, 1, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenDialogHighlight()
//
// Supplies a string that changes the text to the color of
// dialog highlighting.
//
string ColorTokenDialogHighlight()
{
return "<c" + GetSubString(ColorArray, 1, 1) +
GetSubString(ColorArray, 1, 1) +
GetSubString(ColorArray, 254, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenDialogReply()
//
// Supplies a string that changes the text to the color of
// replies in the dialog window.
//
string ColorTokenDialogReply()
{
return "<c" + GetSubString(ColorArray, 102, 1) +
GetSubString(ColorArray, 178, 1) +
GetSubString(ColorArray, 255, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenDM()
//
// Supplies a string that changes the text to the color of
// the DM channel.
//
string ColorTokenDM()
{
return "<c" + GetSubString(ColorArray, 16, 1) +
GetSubString(ColorArray, 223, 1) +
GetSubString(ColorArray, 255, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenGameEngine()
//
// Supplies a string that changes the text to the color of
// many game engine messages.
//
string ColorTokenGameEngine()
{
return "<c" + GetSubString(ColorArray, 204, 1) +
GetSubString(ColorArray, 119, 1) +
GetSubString(ColorArray, 255, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenSavingThrow()
//
// Supplies a string that changes the text to the color of
// saving throw messages.
//
string ColorTokenSavingThrow()
{
return "<c" + GetSubString(ColorArray, 102, 1) +
GetSubString(ColorArray, 204, 1) +
GetSubString(ColorArray, 255, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenScript()
//
// Supplies a string that changes the text to the color of
// messages sent from scripts.
//
string ColorTokenScript()
{
return "<c" + GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 0, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenServer()
//
// Supplies a string that changes the text to the color of
// server messages.
//
string ColorTokenServer()
{
return "<c" + GetSubString(ColorArray, 176, 1) +
GetSubString(ColorArray, 176, 1) +
GetSubString(ColorArray, 176, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenShout()
//
// Supplies a string that changes the text to the color of
// shouts.
//
string ColorTokenShout()
{
return "<c" + GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 239, 1) +
GetSubString(ColorArray, 80, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenSkillCheck()
//
// Supplies a string that changes the text to the color of
// skill check messages.
//
string ColorTokenSkillCheck()
{
return "<c" + GetSubString(ColorArray, 0, 1) +
GetSubString(ColorArray, 102, 1) +
GetSubString(ColorArray, 255, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenTalk()
//
// Supplies a string that changes the text to the color of
// the talk and party talk channels.
//
string ColorTokenTalk()
{
return "<c" + GetSubString(ColorArray, 240, 1) +
GetSubString(ColorArray, 240, 1) +
GetSubString(ColorArray, 240, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenTell()
//
// Supplies a string that changes the text to the color of
// tells.
//
string ColorTokenTell()
{
return "<c" + GetSubString(ColorArray, 32, 1) +
GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 32, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// ColorTokenWhisper()
//
// Supplies a string that changes the text to the color of
// whispers.
//
string ColorTokenWhisper()
{
return "<c" + GetSubString(ColorArray, 128, 1) +
GetSubString(ColorArray, 128, 1) +
GetSubString(ColorArray, 128, 1) + ">";
}
///////////////////////////////////////////////////////////////////////////////
// Colored Name Functions
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// GetNamePCColor()
//
// Returns the name of oPC, surrounded by color tokens, so the color of
// the name is the lighter blue often used in NWN game engine messages.
//
//
string GetNamePCColor(object oPC)
{
return "<c" + GetSubString(ColorArray, 153, 1) +
GetSubString(ColorArray, 255, 1) +
GetSubString(ColorArray, 255, 1) + ">" +
GetName(oPC) + "</c>";
}
///////////////////////////////////////////////////////////////////////////////
// GetNameNPCColor()
//
// Returns the name of oNPC, surrounded by color tokens, so the color of
// the name is the shade of purple often used in NWN game engine messages.
//
string GetNameNPCColor(object oNPC)
{
return "<c" + GetSubString(ColorArray, 204, 1) +
GetSubString(ColorArray, 153, 1) +
GetSubString(ColorArray, 204, 1) + ">" +
GetName(oNPC) + "</c>";
}

Binary file not shown.

View File

@ -0,0 +1,10 @@
int StartingConditional()
{ object oPC = GetPCSpeaker();
int iPageLen = 10;
int iPage = GetLocalInt(oPC, "iConvPage");
int iTotalItems = GetLocalInt(oPC, "iConvTotal");
int iPageTotal = iTotalItems - (iPage * iPageLen);
return (iPageTotal >= 1);
}

Binary file not shown.

View File

@ -0,0 +1,10 @@
int StartingConditional()
{ object oPC = GetPCSpeaker();
int iPageLen = 10;
int iPage = GetLocalInt(oPC, "iConvPage");
int iTotalItems = GetLocalInt(oPC, "iConvTotal");
int iPageTotal = iTotalItems - (iPage * iPageLen);
return (iPageTotal >= 10);
}

Binary file not shown.

View File

@ -0,0 +1,10 @@
int StartingConditional()
{ object oPC = GetPCSpeaker();
int iPageLen = 10;
int iPage = GetLocalInt(oPC, "iConvPage");
int iTotalItems = GetLocalInt(oPC, "iConvTotal");
int iPageTotal = iTotalItems - (iPage * iPageLen);
return (iPageTotal >= 2);
}

Binary file not shown.

View File

@ -0,0 +1,10 @@
int StartingConditional()
{ object oPC = GetPCSpeaker();
int iPageLen = 10;
int iPage = GetLocalInt(oPC, "iConvPage");
int iTotalItems = GetLocalInt(oPC, "iConvTotal");
int iPageTotal = iTotalItems - (iPage * iPageLen);
return (iPageTotal >= 3);
}

Binary file not shown.

View File

@ -0,0 +1,10 @@
int StartingConditional()
{ object oPC = GetPCSpeaker();
int iPageLen = 10;
int iPage = GetLocalInt(oPC, "iConvPage");
int iTotalItems = GetLocalInt(oPC, "iConvTotal");
int iPageTotal = iTotalItems - (iPage * iPageLen);
return (iPageTotal >= 4);
}

Binary file not shown.

View File

@ -0,0 +1,10 @@
int StartingConditional()
{ object oPC = GetPCSpeaker();
int iPageLen = 10;
int iPage = GetLocalInt(oPC, "iConvPage");
int iTotalItems = GetLocalInt(oPC, "iConvTotal");
int iPageTotal = iTotalItems - (iPage * iPageLen);
return (iPageTotal >= 5);
}

Binary file not shown.

View File

@ -0,0 +1,10 @@
int StartingConditional()
{ object oPC = GetPCSpeaker();
int iPageLen = 10;
int iPage = GetLocalInt(oPC, "iConvPage");
int iTotalItems = GetLocalInt(oPC, "iConvTotal");
int iPageTotal = iTotalItems - (iPage * iPageLen);
return (iPageTotal >= 6);
}

Binary file not shown.

View File

@ -0,0 +1,10 @@
int StartingConditional()
{ object oPC = GetPCSpeaker();
int iPageLen = 10;
int iPage = GetLocalInt(oPC, "iConvPage");
int iTotalItems = GetLocalInt(oPC, "iConvTotal");
int iPageTotal = iTotalItems - (iPage * iPageLen);
return (iPageTotal >= 7);
}

Binary file not shown.

View File

@ -0,0 +1,10 @@
int StartingConditional()
{ object oPC = GetPCSpeaker();
int iPageLen = 10;
int iPage = GetLocalInt(oPC, "iConvPage");
int iTotalItems = GetLocalInt(oPC, "iConvTotal");
int iPageTotal = iTotalItems - (iPage * iPageLen);
return (iPageTotal >= 8);
}

Binary file not shown.

View File

@ -0,0 +1,10 @@
int StartingConditional()
{ object oPC = GetPCSpeaker();
int iPageLen = 10;
int iPage = GetLocalInt(oPC, "iConvPage");
int iTotalItems = GetLocalInt(oPC, "iConvTotal");
int iPageTotal = iTotalItems - (iPage * iPageLen);
return (iPageTotal >= 9);
}

Binary file not shown.

View File

@ -0,0 +1,9 @@
int StartingConditional()
{ object oPC = GetPCSpeaker();
int iPageLen = 10;
int iPage = GetLocalInt(oPC, "iConvPage");
int iTotalItems = GetLocalInt(oPC, "iConvTotal");
return (iTotalItems > ((iPage * iPageLen) + iPageLen));
}

Binary file not shown.

View File

@ -0,0 +1,6 @@
int StartingConditional()
{ object oPC = GetPCSpeaker();
int iPage = GetLocalInt(oPC, "iConvPage");
return (iPage != 0);
}

Binary file not shown.

View File

@ -0,0 +1,9 @@
void main()
{
object oPC = GetPCSpeaker();
DeleteLocalInt(oPC, "iConvPage");
DeleteLocalInt(oPC, "iConvChoice");
DeleteLocalString(oPC, "sConvScript");
DeleteLocalInt(oPC, "iConvTotal");
}

Binary file not shown.

View File

@ -0,0 +1,6 @@
void main()
{ object oPC = GetPCSpeaker();
int iPage = GetLocalInt(oPC, "iConvPage");
iPage++;
SetLocalInt(oPC, "iConvPage", iPage);
}

Binary file not shown.

View File

@ -0,0 +1,6 @@
void main()
{ object oPC = GetPCSpeaker();
int iPage = GetLocalInt(oPC, "iConvPage");
iPage--;
SetLocalInt(oPC, "iConvPage", iPage);
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,12 @@
/* paste the following in your OnActivateItem module event
// *add: Social Pheno v2* \\
if(GetTag(oItem) == "TBIT_BANJO")
{
ExecuteScript("tbx0_banjo01",GetItemActivator());
}
// *end: Social Pheno v2* \\

Binary file not shown.

View File

@ -0,0 +1,285 @@
#include "x0_i0_anims"
// #include "x0_i0_walkway" - in x0_i0_anims
#include "x0_i0_treasure"
#include "x2_inc_switches"
void main()
{
// ***** Spawn-In Conditions ***** //
// * REMOVE COMMENTS (// ) before the "Set..." functions to activate
// * them. Do NOT touch lines commented out with // *, those are
// * real comments for information.
// * This causes the creature to say a one-line greeting in their
// * conversation file upon perceiving the player. Put [NW_D2_GenCheck]
// * in the "Text Seen When" field of the greeting in the conversation
// * file. Don't attach any player responses.
// *
// SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
// * Same as above, but for hostile creatures to make them say
// * a line before attacking.
// *
// SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// * This NPC will attack when its allies call for help
// *
// SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// * If the NPC has the Hide skill they will go into stealth mode
// * while doing WalkWayPoints().
// *
// SetSpawnInCondition(NW_FLAG_STEALTH);
//--------------------------------------------------------------------------
// Enable stealth mode by setting a variable on the creature
// Great for ambushes
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_STEALTH) == TRUE)
{
SetSpawnInCondition(NW_FLAG_STEALTH);
}
// * Same, but for Search mode
// *
// SetSpawnInCondition(NW_FLAG_SEARCH);
//--------------------------------------------------------------------------
// Make creature enter search mode after spawning by setting a variable
// Great for guards, etc
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_SEARCH) == TRUE)
{
SetSpawnInCondition(NW_FLAG_SEARCH);
}
// * This will set the NPC to give a warning to non-enemies
// * before attacking.
// * NN -- no clue what this really does yet
// *
// SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// * Separate the NPC's waypoints into day & night.
// * See comment on WalkWayPoints() for use.
// *
// SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
// * If this is set, the NPC will appear using the "EffectAppear"
// * animation instead of fading in, *IF* SetListeningPatterns()
// * is called below.
// *
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
// * This will cause an NPC to use common animations it possesses,
// * and use social ones to any other nearby friendly NPCs.
// *
// SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
//--------------------------------------------------------------------------
// Enable immobile ambient animations by setting a variable
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT_IMMOBILE) == TRUE)
{
SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
}
// * Same as above, except NPC will wander randomly around the
// * area.
// *
// SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
//--------------------------------------------------------------------------
// Enable mobile ambient animations by setting a variable
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT) == TRUE)
{
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
}
// **** Animation Conditions **** //
// * These are extra conditions you can put on creatures with ambient
// * animations.
// * Civilized creatures interact with placeables in
// * their area that have the tag "NW_INTERACTIVE"
// * and "talk" to each other.
// *
// * Humanoid races are civilized by default, so only
// * set this flag for monster races that you want to
// * behave the same way.
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
// * If this flag is set, this creature will constantly
// * be acting. Otherwise, creatures will only start
// * performing their ambient animations when they
// * first perceive a player, and they will stop when
// * the player moves away.
// SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// * Civilized creatures with this flag set will
// * randomly use a few voicechats. It's a good
// * idea to avoid putting this on multiple
// * creatures using the same voiceset.
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// * Creatures with _immobile_ ambient animations
// * can have this flag set to make them mobile in a
// * close range. They will never leave their immediate
// * area, but will move around in it, frequently
// * returning to their starting point.
// *
// * Note that creatures spawned inside interior areas
// * that contain a waypoint with one of the tags
// * "NW_HOME", "NW_TAVERN", "NW_SHOP" will automatically
// * have this condition set.
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
// **** Special Combat Tactics *****//
// * These are special flags that can be set on creatures to
// * make them follow certain specialized combat tactics.
// * NOTE: ONLY ONE OF THESE SHOULD BE SET ON A SINGLE CREATURE.
// * Ranged attacker
// * Will attempt to stay at ranged distance from their
// * target.
// SetCombatCondition(X0_COMBAT_FLAG_RANGED);
// * Defensive attacker
// * Will use defensive combat feats and parry
// SetCombatCondition(X0_COMBAT_FLAG_DEFENSIVE);
// * Ambusher
// * Will go stealthy/invisible and attack, then
// * run away and try to go stealthy again before
// * attacking anew.
// SetCombatCondition(X0_COMBAT_FLAG_AMBUSHER);
// * Cowardly
// * Cowardly creatures will attempt to flee
// * attackers.
// SetCombatCondition(X0_COMBAT_FLAG_COWARDLY);
// **** Escape Commands ***** //
// * NOTE: ONLY ONE OF THE FOLLOWING SHOULD EVER BE SET AT ONE TIME.
// * NOTE2: Not clear that these actually work. -- NN
// * Flee to a way point and return a short time later.
// *
// SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN);
// * Flee to a way point and do not return.
// *
// SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE);
// * Teleport to safety and do not return.
// *
// SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE);
// * Teleport to safety and return a short time later.
// *
// SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN);
// ***** CUSTOM USER DEFINED EVENTS ***** /
/*
If you uncomment any of these conditions, the creature will fire
a specific user-defined event number on each event. That will then
allow you to write custom code in the "OnUserDefinedEvent" handler
script to go on top of the default NPC behaviors for that event.
Example: I want to add some custom behavior to my NPC when they
are damaged. I uncomment the "NW_FLAG_DAMAGED_EVENT", then create
a new user-defined script that has something like this in it:
if (GetUserDefinedEventNumber() == 1006) {
// Custom code for my NPC to execute when it's damaged
}
These user-defined events are in the range 1001-1007.
*/
// * Fire User Defined Event 1001 in the OnHeartbeat
// *
SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT);
// * Fire User Defined Event 1002
// *
// SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT);
// * Fire User Defined Event 1005
// *
SetSpawnInCondition(NW_FLAG_ATTACK_EVENT);
// * Fire User Defined Event 1006
// *
SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT);
// * Fire User Defined Event 1008
// *
// SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT);
// * Fire User Defined Event 1003
// *
// SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT);
// * Fire User Defined Event 1004
// *
// SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT);
SetSpawnInCondition(NW_FLAG_SPELL_CAST_AT_EVENT);
// ***** DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***** //
// * Goes through and sets up which shouts the NPC will listen to.
// *
SetListeningPatterns();
// * Walk among a set of waypoints.
// * 1. Find waypoints with the tag "WP_" + NPC TAG + "_##" and walk
// * among them in order.
// * 2. If the tag of the Way Point is "POST_" + NPC TAG, stay there
// * and return to it after combat.
//
// * Optional Parameters:
// * void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
//
// * If "NW_FLAG_DAY_NIGHT_POSTING" is set above, you can also
// * create waypoints with the tags "WN_" + NPC Tag + "_##"
// * and those will be walked at night. (The standard waypoints
// * will be walked during the day.)
// * The night "posting" waypoint tag is simply "NIGHT_" + NPC tag.
WalkWayPoints();
SetImmortal(OBJECT_SELF,TRUE);
//* Create a small amount of treasure on the creature
if ((GetLocalInt(GetModule(), "X2_L_NOTREASURE") == FALSE) &&
(GetLocalInt(OBJECT_SELF, "X2_L_NOTREASURE") == FALSE) )
{
CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF);
}
// ***** ADD ANY SPECIAL ON-SPAWN CODE HERE ***** //
// * If Incorporeal, apply changes
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_IS_INCORPOREAL) == TRUE)
{
effect eConceal = EffectConcealment(50, MISS_CHANCE_TYPE_NORMAL);
eConceal = ExtraordinaryEffect(eConceal);
effect eGhost = EffectCutsceneGhost();
eGhost = ExtraordinaryEffect(eGhost);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, OBJECT_SELF);
}
}

Binary file not shown.

View File

@ -0,0 +1,500 @@
/*
Tz-Auber's Perfect Troll Regeneration Script 1.3
By: Tz-Auber
Last Modified: 9/23/03
Developed for: 1.30/SoU
Description
-----------
This small script properly implements 3rd Edition subdual damage rules as it relates
to regeneration. Some of the highlighted features are:
- By using the SetImmortal function, feedback for the Troll's health is properly
displayed.
- Only uses OnHeartbeat and OnDamaged events. No messing with OnDeath and XP
calculations.
- Allows for quickly killing a downed Troll through a specified item (by default,
a torch item type equipped in the off-hand) or through SoU grenade type
weapons (Acid Flask and Alchemist Fire).
- A knockdown effect occurs when actual damage exceeds subdual damage, and it
also simulates attacking a prone opponent.
- Allows for automatic 3E Coup de Grace attempts if the Troll is down and the equipped
weapon is capable of doing permanent damage.
Modifications Required
----------------------
- This script must be placed in a creature's OnUserDefined event.
- The OnSpawn script must have the following SetSpawnInConditions uncommented/added:
- NW_FLAG_HEARTBEAT_EVENT
- NW_FLAG_DAMAGED_EVENT
- NW_FLAG_ATTACK_EVENT
- NW_FLAG_SPELL_CAST_AT_EVENT
- The following line must be added in the OnSpawn script at the end
- SetImmortal(OBJECT_SELF,TRUE);
- Remove the default Troll's regeneration property by removing it's hide from the
creature inventory (or remove the regeneration property if you want to keep
other hide properties).
Credits
-------
I want to thank U'lias, as I used his code for a basis and starting point
(creation date 12/29/02). His code can be found by searching the vault under
"Ulias' 3eMM D&D Style Trolls v1.3"
I would also like to thank El Magnifico Uno, one of the pioneers of Troll
regeneration code, who also provided useful critique in the development of this
work.
Version History
---------------
1.5 (8/3/06, Resonance)
* Making the full round burning uninterruptible can also glitch PCs so that
they are stuck until they relog, so remove that. PCs will still play the
bending over animation, and will still queue attacks until after that
finishes, but if they run, they can break out of the animation immediately
without problems.
1.4 (8/1/06, Resonance)
* Acid, Fire, and Death Magic spells now properly act like grenades
* Forcing the PCs to run to the target on Coup de Grace causes locks, so removed.
* Burning the body from melee still takes a full round
* Flame Weapon and Darkfire now make weapons count as torches
* There is no apparent way to get Flame Weapon/Darkfire damage to
actually count as fire damage, however -- it is always subdual.
* Coup de Grace damage is now cumulative for setting DC
* Factored out fire and acid death effect code
1.3 (9/23/03) - Found out that my code has just been released into the wilds of
a PW and have received a lot of useful feedback. New features added: support
for 3E Coup de Grace attempts and the use of Alchemist Fire and Acid Flasks
to fry a Troll in addition to the torch.
1.2 (9/22/03) - Hmm.. this was supposed to come sooner, but here it is. Changed
from a resref dependency of the burning item, to a base item type dependency.
So any BASE_ITEM_TORCH equipped in the off-hand should work regardless of
tags and resrefs. Finally added debug message considerations. I'll save
the final spell modifications when HotU comes out, but a small placeholder
is there in the meantime.
1.1 (7/24/03) - My implementation of subdual rules were a little messed up. I'm now
considering damage in excess of the limit of SetImmortal function. Also
added visual effect support for acid damaging weapons and tweaked with the
fire visual effects a little.
1.0 (7/21/03) - Initial Release
*/
// Included for the RemoveSpecificEffect function
#include "nw_i0_spells"
// The amount of hitpoints (subdual damage) regenerated per round
const int REGENERATION_VALUE = 5;
// The time it takes (in full rounds) to burn a Troll
const int BURNING_TIME = 1;
// Switching debug messages on/off
const int DEBUG_OUTPUT = 0;
void BurnEffect()
{
CreateObject(OBJECT_TYPE_PLACEABLE, "plc_weathmark", GetLocation(OBJECT_SELF), TRUE);
}
// Find out if the weapon is burning from Flame Weapon or Darkfire
int GetIsBurning(object oItem)
{
// Start by checking to see if it's a torch
if(GetBaseItemType(oItem) == BASE_ITEM_TORCH) return TRUE;
// Now check for Flame Weapon or Darkfire
itemproperty ip = GetFirstItemProperty(oItem);
while (GetIsItemPropertyValid(ip))
{
if (GetItemPropertyType(ip) == ITEM_PROPERTY_ONHITCASTSPELL)
{
if (GetItemPropertySubType(ip) == 127) return TRUE; // Darkfire
if (GetItemPropertySubType(ip) == 124) return TRUE; // Flame Weapon
if (GetItemPropertySubType(ip) == 301) return TRUE; //Purist Burning Blade
}
ip = GetNextItemProperty(oItem);
}
return FALSE;
}
// Returns 0 if the spell does neither fire nor acid damage
// Returns 1 if the spell does acid damage
// Returns 2 if the spell does fire damage (or both fire and acid)
// Returns 3 if the spell is death magic
// Grenades are counted as spells
int IsAcidFireDeathSpell(int nSpellID)
{
int retval = 0; // Default to neither fire nor acid
switch(nSpellID)
{
// Check for acid spells
case SPELL_ACID_FOG:
case SPELL_ACID_SPLASH:
case SPELL_CLOUDKILL:
case SPELL_GRENADE_ACID:
case SPELL_MELFS_ACID_ARROW:
case SPELL_MESTILS_ACID_BREATH:
case SPELL_MESTILS_ACID_SHEATH:
case SPELL_STORM_OF_VENGEANCE:
retval = 1;
break;
// Check for fire spells
// Flame Weapon/Darkfire from OnHit don't count?
case SPELL_BURNING_HANDS:
case SPELL_COMBUST:
case SPELL_DARKFIRE:
case SPELL_DELAYED_BLAST_FIREBALL:
case SPELL_EPIC_HELLBALL:
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_GRENADE_FIRE:
case SPELL_INCENDIARY_CLOUD:
case SPELL_INFERNO:
case SPELL_METEOR_SWARM:
case SPELL_SEARING_LIGHT:
case SPELL_SHADES_FIREBALL:
case SPELL_SHADES_WALL_OF_FIRE:
case SPELL_SUNBEAM:
case SPELL_SUNBURST:
retval = 2;
break;
// Check for death magic
case SPELL_CIRCLE_OF_DEATH:
case SPELL_DESTRUCTION:
case SPELL_FINGER_OF_DEATH:
case SPELL_IMPLOSION:
case SPELL_POWER_WORD_KILL:
case SPELL_SLAY_LIVING:
case SPELL_WAIL_OF_THE_BANSHEE:
case SPELL_WORD_OF_FAITH:
retval = 3;
break;
}
return retval;
}
// Troll death effect: fire damage
void FireDeathEffect(object oTroll)
{
effect eFlame = EffectVisualEffect(VFX_DUR_INFERNO_CHEST); //VFX_IMP_FLAME_M
DelayCommand(2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFlame, oTroll, 3.0));
DelayCommand(1.5, BurnEffect());
//object oFlame = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_flamemedium", GetLocation(oTroll), TRUE);
//DestroyObject(oFlame, 3.25);
return;
}
// Troll death effect: acid damage
void AcidDeathEffect(object oTroll)
{
effect eAcid = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_ACID);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eAcid, oTroll);
return;
}
void main()
{
int nUser = GetUserDefinedEventNumber();
if(nUser == EVENT_HEARTBEAT) // OnHeartbeat Event
{
// the Troll's cumulative Fire and Acid damage
int nPermanentDamage = GetLocalInt(OBJECT_SELF, "nPermanentDamage");;
// the Troll's original maximum hitpoints
int nOriginalHPs = GetMaxHitPoints(OBJECT_SELF);
// the Troll's current hitpoints
int nCurrentHPs = GetCurrentHitPoints(OBJECT_SELF);
// the Troll's excess damage
int nExcessDamage = GetLocalInt(OBJECT_SELF, "nExcessDamage");
// the maximum number of HPs that the Troll can possibly regenerate due
// to permanent fire or acid damage
int nMaxHPsPossible = nOriginalHPs - nPermanentDamage;
// Debug Stuff
if(DEBUG_OUTPUT)
{
SendMessageToPC(GetFirstPC(),"Current HPs = " + IntToString(nCurrentHPs));
SendMessageToPC(GetFirstPC(),"Subdual Damage = " + IntToString(nMaxHPsPossible - nCurrentHPs));
SendMessageToPC(GetFirstPC(),"Excess Damage = " + IntToString(nExcessDamage));
SendMessageToPC(GetFirstPC(),"Effective HPs = " + IntToString(nCurrentHPs - nExcessDamage));
SendMessageToPC(GetFirstPC(),"Max Possible HPs = " + IntToString(nMaxHPsPossible) + "/" + IntToString(nOriginalHPs));
SendMessageToPC(GetFirstPC(),"-----");
}
// the Troll may only regenerate if its current HPs are less than its
// maximum possible HPs left after fire and acid damage
if(nExcessDamage >= REGENERATION_VALUE)
{
nExcessDamage -= REGENERATION_VALUE;
SetLocalInt(OBJECT_SELF, "nExcessDamage", nExcessDamage);
}
else if(nExcessDamage > 0)
{
// regeneration effect (the excess difference)
effect eHeal = EffectHeal(REGENERATION_VALUE - nExcessDamage);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF);
nExcessDamage = 0;
SetLocalInt(OBJECT_SELF, "nExcessDamage", nExcessDamage);
}
else if (nCurrentHPs <= (nMaxHPsPossible - REGENERATION_VALUE))
{
// regeneration effect (5 HPs every round)
effect eHeal = EffectHeal(REGENERATION_VALUE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF);
}
else if (nCurrentHPs <= nMaxHPsPossible)
{
// regeneration effect (the remainder of hitpoints)
effect eHeal = EffectHeal(nMaxHPsPossible - nCurrentHPs);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF);
}
// the Troll will now see if it can get up after it's latest beating
// provided that the Troll is grounded
effect eKnockdown = EffectKnockdown();
int bDowned = GetLocalInt(OBJECT_SELF,"bDowned");
// When current subdual damage is lower than current hit points
if (((nMaxHPsPossible - nCurrentHPs + nExcessDamage) < nMaxHPsPossible)&&(bDowned))
{
RemoveSpecificEffect(GetEffectType(eKnockdown),OBJECT_SELF);
SetLocalInt(OBJECT_SELF,"bDowned",0);
}
}
else if(nUser == EVENT_DAMAGED) // OnDamaged Event
{
object oDamager = GetLastDamager();
// the Troll's cumulative Permanent damage
int nPermanentDamage = GetLocalInt(OBJECT_SELF, "nPermanentDamage");
// the Troll's current Fire damage newly received
int nFireDamage = GetDamageDealtByType(DAMAGE_TYPE_FIRE);
// the Troll's current Acid damage newly received
int nAcidDamage = GetDamageDealtByType(DAMAGE_TYPE_ACID);
// the rest of the damage inflicted on the Troll
int nOtherDamage = GetTotalDamageDealt() - nFireDamage - nAcidDamage;
// the Troll's excess damage
int nExcessDamage = GetLocalInt(OBJECT_SELF, "nExcessDamage");
// the Troll's coup de grace cumulative damage
int nCoupDamage = GetLocalInt(OBJECT_SELF, "nCoupDamage");
// the Troll's current hitpoints
int nCurrentHPs = GetCurrentHitPoints(OBJECT_SELF);
// the Troll's previous (newly inflicted HP value)
int nPrevHPs = GetLocalInt(OBJECT_SELF, "nPrevHPs");
// in case this is the first time the Troll is damaged
if(nPrevHPs == 0)
nPrevHPs = GetMaxHitPoints(OBJECT_SELF);
// if there is damage in excess of the previous hp value,
// excess damage will be updated
if(nOtherDamage > nPrevHPs)
nExcessDamage += (nOtherDamage - nPrevHPs);
// Now the excess damage and previous hit points will be updated
SetLocalInt(OBJECT_SELF,"nExcessDamage",nExcessDamage);
SetLocalInt(OBJECT_SELF,"nPrevHPs",nCurrentHPs);
// make sure Fire damage is not less than 0
if (nFireDamage < 0) nFireDamage = 0;
// make sure Acid damage is not less than 0
if (nAcidDamage < 0) nAcidDamage = 0;
// if the Troll suffered Fire damage
if (nFireDamage > 0)
{
// keep track of cumulative Fire damage
nPermanentDamage += nFireDamage;
// won't be counted as subdual damage
effect eHeal = EffectHeal(nFireDamage);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF);
}
// if the Troll suffered Acid damage
if (nAcidDamage > 0)
{
// keep track of cumulative Acid damage
nPermanentDamage += nAcidDamage;
// won't be counted as subdual damage
effect eHeal = EffectHeal(nAcidDamage);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF);
}
// Apply the Permanent Damage
SetLocalInt(OBJECT_SELF,"nPermanentDamage",nPermanentDamage);
// the Troll's original maximum hitpoints
int nOriginalHPs = GetMaxHitPoints(OBJECT_SELF);
// the maximum number of HPs that the Troll can possibly regenerate due
// to permanent fire or acid damage
int nMaxHPsPossible = nOriginalHPs - nPermanentDamage;
// This part will simulate an unconscience effect via knockdown
// If the troll's subdual damage exceeds it's current hitpoints ...
effect eKnockdown = EffectKnockdown();
int bDowned = GetLocalInt(OBJECT_SELF,"bDowned");
// When current subdual damage is higher than current hit points
if ((nMaxHPsPossible < (nMaxHPsPossible - nCurrentHPs + nExcessDamage))&&(!bDowned))
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eKnockdown,OBJECT_SELF);
bDowned = 1;
SetLocalInt(OBJECT_SELF,"bDowned",bDowned);
}
// Now let's check and see if the troll has attained final death
// First we'll check whether someone is carefully burning the body
// (will take a full round to perform)
object oLeftHandItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oDamager);
object oRightHandItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oDamager);
if( bDowned && (GetIsBurning(oLeftHandItem) || GetIsBurning(oRightHandItem)) )
{
// DelayCommand(0.2,SetCommandable(FALSE,oDamager));
AssignCommand(oDamager, ClearAllActions());
AssignCommand(oDamager, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, RoundsToSeconds(BURNING_TIME)));
// AssignCommand(oDamager, ActionDoCommand(SetCommandable(TRUE,oDamager)));
FireDeathEffect(OBJECT_SELF);
effect eDeath = EffectDeath();
SetImmortal(OBJECT_SELF,FALSE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, OBJECT_SELF);
}
else if( bDowned && (GetLocalInt(oDamager, "VAR_IGNITESPELL") == 1))
{
// DelayCommand(0.2,SetCommandable(FALSE,oDamager));
AssignCommand(oDamager, ClearAllActions());
AssignCommand(oDamager, ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP, 0.8, RoundsToSeconds(BURNING_TIME)));
// AssignCommand(oDamager, ActionDoCommand(SetCommandable(TRUE,oDamager)));
FireDeathEffect(OBJECT_SELF);
effect eDeath = EffectDeath();
SetImmortal(OBJECT_SELF,FALSE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, OBJECT_SELF);
}
// Now let's check and see if the damager is capable of performing a
// Coup de Grace attempt, and if so they will automatically perform one.
// The Troll's save will be Fortitude of DC 10 + Permanent Damage dealt.
else if (GetLocalInt(OBJECT_SELF,"bCoupdeGrace") && !GetLocalInt(OBJECT_SELF,"bGrenade")
&& (nFireDamage || nAcidDamage) && bDowned)
{
DeleteLocalInt(OBJECT_SELF,"bCoupdeGrace");
object eSelf = OBJECT_SELF;
location lSelf = GetLocation(eSelf);
// DelayCommand(0.2,SetCommandable(FALSE,oDamager));
// AssignCommand(oDamager, ClearAllActions());
// AssignCommand(oDamager, ActionMoveToObject(eSelf,TRUE,0.1));
// AssignCommand(oDamager, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 4.5));
// //AssignCommand(oDamager, ActionDoCommand(SetCommandable(TRUE,oDamager)));
nCoupDamage = nCoupDamage + nFireDamage + nAcidDamage;
if(!FortitudeSave(OBJECT_SELF,10 + nCoupDamage,
SAVING_THROW_TYPE_ALL, oDamager))
{
effect eBlood = EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL);
// AssignCommand(oDamager, ActionDoCommand(ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eBlood, lSelf)));
// AssignCommand(oDamager, ActionDoCommand(SetCommandable(TRUE,oDamager)));
FloatingTextStringOnCreature("Coup de Grace (success)",oDamager);
// Fire will be favored over acid in the event they are equal
if(nFireDamage >= nAcidDamage)
{
FireDeathEffect(OBJECT_SELF);
}
else
{
AcidDeathEffect(OBJECT_SELF);
}
effect eDeath = EffectDeath();
SetImmortal(OBJECT_SELF,FALSE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, OBJECT_SELF);
}
else // Fort save succeeded, store cumulative coup damage
{
// AssignCommand(oDamager, ActionDoCommand(SetCommandable(TRUE,oDamager)));
SetLocalInt(OBJECT_SELF, "nCoupDamage", nCoupDamage);
FloatingTextStringOnCreature("Coup de Grace (failure)",oDamager);
}
}
// ... or if it took damage the old fashioned way ...
// (i.e. all hitpoints exhausted due to fire and/or acid)
else if (nMaxHPsPossible <= 0)
{
SetImmortal(OBJECT_SELF,FALSE);
// Fire will be favored over acid in the event they are equal
if(nFireDamage >= nAcidDamage)
{
FireDeathEffect(OBJECT_SELF);
}
else
{
AcidDeathEffect(OBJECT_SELF);
}
effect eDeath = EffectDeath();
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, OBJECT_SELF);
}
}
else if(nUser == EVENT_SPELL_CAST_AT) // OnSpellCastAt Event
{
int nSpellID = GetLastSpell();
int nAcidFireDeath = IsAcidFireDeathSpell(nSpellID);
object oCaster = GetLastSpellCaster();
// Will consider all instant death effects, acid and fire damage from
// both spells and grenades
if(GetLastSpellHarmful())
{
if(GetLocalInt(OBJECT_SELF,"bDowned") && nAcidFireDeath)
{
SetLocalInt(OBJECT_SELF,"bGrenade",1);
object eSelf = OBJECT_SELF;
// DelayCommand(0.2,SetCommandable(FALSE,oCaster));
// AssignCommand(oCaster, ClearAllActions());
// AssignCommand(oCaster, ActionMoveToObject(eSelf,TRUE,0.1));
// AssignCommand(oCaster, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, RoundsToSeconds(BURNING_TIME)));
// AssignCommand(oCaster, ActionDoCommand(SetCommandable(TRUE,oCaster)));
if(nAcidFireDeath == 2)
{
FireDeathEffect(OBJECT_SELF);
}
else if(nAcidFireDeath == 1)
{
AcidDeathEffect(OBJECT_SELF);
}
effect eDeath = EffectDeath();
SetImmortal(OBJECT_SELF,FALSE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, OBJECT_SELF);
}
}
// Will consider all healing effects
else
{
}
}
else if(nUser == EVENT_ATTACKED) // OnPhysicalAttacked Event
{
if(GetLocalInt(OBJECT_SELF,"bDowned"))
{
SetLocalInt(OBJECT_SELF,"bCoupdeGrace",1);
}
}
}

Binary file not shown.

View File

@ -0,0 +1,52 @@
//File name: df_t0_camopita
//Description: Scrips for use with CEP pit traps.
#include "zep_inc_scrptdlg"
void main()
{
object oPC = GetEnteringObject();
//Now we make them fall in the hole.
int nDC;
int nDamage;
object oTrap = GetAreaOfEffectCreator(OBJECT_SELF);
string sTag = GetTag(oTrap);
nDamage =d6(1);
if(GetTrapDetectedBy(oTrap,oPC))
nDC = 10;
else
nDC = 25;
string sMessageToPC;
if(ReflexSave(oPC, nDC, SAVING_THROW_TYPE_TRAP))
{
sMessageToPC=GetStringByStrRef(nZEPPitJump,GENDER_MALE);
SendMessageToPC(oPC,sMessageToPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect( VFX_IMP_REFLEX_SAVE_THROW_USE), oPC);
}
else
{
sMessageToPC=GetStringByStrRef(nZEPPitFall,GENDER_MALE);
SendMessageToPC(oPC,sMessageToPC);
AssignCommand(oPC,PlaySound("cb_ht_fleshston2"));
PlayVoiceChat(VOICE_CHAT_PAIN3,oPC);
if(GetCurrentHitPoints(oPC)-nDamage>0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDisappearAppear(GetLocation(oPC)), oPC, 30.0f);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectParalyze(), oPC, 30.0f);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL), oPC);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), GetLocation(oPC));
sMessageToPC=GetStringByStrRef(nZEPPitClimb,GENDER_MALE);
DelayCommand(30.0,SendMessageToPC(oPC,sMessageToPC));
}
else
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL), oPC);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), GetLocation(oPC));
}
}
}

Binary file not shown.

View File

@ -0,0 +1,52 @@
//File name: df_t0_deeppita
//Usage: Scripts for use with CEP Deep pit trap.
#include "zep_inc_scrptdlg"
void main()
{
object oPC = GetEnteringObject();
//Now we make them fall in the hole.
int nDC;
int nDamage;
object oTrap = GetAreaOfEffectCreator(OBJECT_SELF);
string sTag = GetTag(oTrap);
nDamage =d6(2);
if(GetTrapDetectedBy(oTrap,oPC))
nDC = 10;
else
nDC = 15;
string sMessageToPC;
if(ReflexSave(oPC, nDC, SAVING_THROW_TYPE_TRAP))
{
sMessageToPC=GetStringByStrRef(nZEPPitJump,GENDER_MALE);
SendMessageToPC(oPC,sMessageToPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect( VFX_IMP_REFLEX_SAVE_THROW_USE), oPC);
}
else
{
sMessageToPC=GetStringByStrRef(nZEPPitFall,GENDER_MALE);
SendMessageToPC(oPC,sMessageToPC);
AssignCommand(oPC,PlaySound("cb_ht_fleshston2"));
PlayVoiceChat(VOICE_CHAT_PAIN3,oPC);
if(GetCurrentHitPoints(oPC)-nDamage>0)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDisappearAppear(GetLocation(oPC)), oPC, 30.0f);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectParalyze(), oPC, 30.0f);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL), oPC);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), GetLocation(oPC));
sMessageToPC=GetStringByStrRef(nZEPPitClimb,GENDER_MALE);
DelayCommand(30.0,SendMessageToPC(oPC,sMessageToPC));
}
else
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL), oPC);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), GetLocation(oPC));
}
}
}

Binary file not shown.

View File

@ -0,0 +1,81 @@
void TrapPlayAnim(object oTrap)
{
AssignCommand(oTrap, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
}
void ResetWhirlingBlades()
{
object oTrap = GetLocalObject(OBJECT_SELF,"TRP_TRP");
DeleteLocalInt(oTrap,"TRP_TRIGGERED");
PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
DestroyObject(OBJECT_SELF);
if(GetIsObjectValid(oTrap))
{
DeleteLocalInt(oTrap,"TRP_TRP");
}
}
void main()
{
if(GetLocalInt(OBJECT_SELF,"TRP_TRIGGERED"))
return;
SetLocalInt(OBJECT_SELF,"TRP_TRIGGERED",1);
object oTrap;
if(GetLocalInt(OBJECT_SELF,"TRP_PLCBL_SHOW")==0)
{
location lPlcbl = GetLocalLocation(OBJECT_SELF,"TRP_PLCBL_LOC");
SetLocalInt(OBJECT_SELF,"TRP_PLCBL_SHOW",1);
oTrap = CreateObject(OBJECT_TYPE_PLACEABLE,"whirlbladepcbl",lPlcbl);
SetLocalObject(OBJECT_SELF,"TRP_PLCBL_OBJ",oTrap);
}
else
oTrap = GetLocalObject(OBJECT_SELF,"TRP_PLCBL_OBJ");
AssignCommand(oTrap,DelayCommand(1.0,TrapPlayAnim(oTrap)));
AssignCommand(oTrap,ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectAreaOfEffect(40),GetLocation(oTrap),120.0));
AssignCommand(oTrap,DelayCommand(120.0, ResetWhirlingBlades()));
object oThis = OBJECT_SELF;
SetLocalObject(oTrap, "TRP_TRP", oThis);
int nDC;
int nDamage;
string sTag = GetTag(oTrap);
object oPC = GetFirstObjectInShape(SHAPE_SPHERE,5.0,GetLocation(oTrap));
while(GetIsObjectValid(oPC))
{
nDamage = d4(2)+4;
nDC = 20;
if(!ReflexSave(oPC, nDC, SAVING_THROW_TYPE_TRAP))
{
if (GetHasFeat(FEAT_IMPROVED_EVASION, oPC))
{
nDamage /= 2;
}
}
else if (GetHasFeat(FEAT_EVASION, oPC) || GetHasFeat(FEAT_IMPROVED_EVASION, oPC))
{
nDamage = 0;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect( VFX_IMP_REFLEX_SAVE_THROW_USE), oPC);
}
else
{
nDamage /= 2;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect( VFX_IMP_REFLEX_SAVE_THROW_USE), oPC);
}
if(nDamage>0)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_SLASHING, DAMAGE_POWER_NORMAL), oPC);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_BLOOD_CRT_RED), GetLocation(oPC));
}
oPC = GetNextObjectInShape(SHAPE_SPHERE,5.0,GetLocation(oTrap));
}
}

Binary file not shown.

View File

@ -0,0 +1,73 @@
void TrapPlayAnim(object oTrap)
{
AssignCommand(oTrap, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
}
void FallingBrickHitPC(object oPC, int nDamage)
{
object oTrap = GetLocalObject(OBJECT_SELF,"TRP_PLCBL_OBJ");
PlayVoiceChat(VOICE_CHAT_PAIN2,oPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect( VFX_COM_BLOOD_CRT_RED), oPC);
AssignCommand(oTrap,ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL), oPC));
}
int TrapSave(object oPC, int nDC, int nDamage)
{
if(!ReflexSave(oPC, nDC, SAVING_THROW_TYPE_TRAP))
{
if (GetHasFeat(FEAT_IMPROVED_EVASION, oPC))
nDamage /= 2;
}
else if (GetHasFeat(FEAT_EVASION, oPC) || GetHasFeat(FEAT_IMPROVED_EVASION, oPC))
{
nDamage = 0;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect( VFX_IMP_REFLEX_SAVE_THROW_USE), oPC);
}
else
nDamage /= 2;
return nDamage;
}
void main()
{
if(GetLocalInt(OBJECT_SELF,"TRP_TRIGGERED"))
return;
SetLocalInt(OBJECT_SELF,"TRP_TRIGGERED",1);
object oTrap;
if(GetLocalInt(OBJECT_SELF,"TRP_PLCBL_SHOW")==0)
{
location lPlcbl = GetLocalLocation(OBJECT_SELF,"TRP_PLCBL_LOC");
SetLocalInt(OBJECT_SELF,"TRP_PLCBL_SHOW",1);
oTrap = CreateObject(OBJECT_TYPE_PLACEABLE,"fallingbrickpcbl",lPlcbl);
SetLocalObject(OBJECT_SELF,"TRP_PLCBL_OBJ",oTrap);
}
else
oTrap = GetLocalObject(OBJECT_SELF,"TRP_PLCBL_OBJ");
AssignCommand(oTrap,DelayCommand(1.0,TrapPlayAnim(oTrap)));
int nDC = 15;
object oPC = GetNearestObject(OBJECT_TYPE_CREATURE, oTrap);
AssignCommand(oPC, PlaySound("as_na_rockfallg1"));//cb_bu_stonelg
int nDamage,nN;
while(GetIsObjectValid(oPC)&&(GetDistanceBetween(oTrap,oPC)<2.0))
{
nDamage = d6(2);
nDamage = TrapSave(oPC, nDC, nDamage);
if(nDamage>0)
{
DelayCommand(1.1,FallingBrickHitPC(oPC,nDamage));
}
nN++;
oPC = GetNearestObject(OBJECT_TYPE_CREATURE, oTrap, nN);
}
}

Binary file not shown.

View File

@ -0,0 +1,18 @@
void TrapPlayAnim(object oTrap)
{
AssignCommand(oTrap, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
}
void main()
{
if(GetLocalInt(OBJECT_SELF,"TRP_TRIGGERED"))
return;
SetLocalInt(OBJECT_SELF,"TRP_TRIGGERED",1);
object oTrap = GetLocalObject(OBJECT_SELF,"TRP_PLCBL_OBJ");
TrapPlayAnim(oTrap);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectAreaOfEffect(38),GetLocation(oTrap),HoursToSeconds(200));
return;
}

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