I’m janking around with nw_c2_default7, the bioware ondeath for creatures event script
I already have stuff from a pw xp script in there that executes a script and a workaround for double xp messages if the critter somehow kills itself. Im leaving out the default9 code and the other stuff from the pw xp script I got off the vault and just showing what I wrote
Its a code that only kicks in if the area the murder happens in has a local int variable called QAREABOO set to 1 and the creature that was killed had a string variable called KILLQ set on it other than “” Then it increments KILLQ by one - the purpose of this is: quests where you need to go kill # of monsters in so and so area, so I dont have to have them drop a rat ear or whatever.
It also is designed to update the quest for every PC in the area, even if they are not in the same party - while this theoretically can be exploited, I dont plan to implement it in a fashion where it would be particularly more rewarding than just adventuring. Im doing it outside of GetNextFactionMember looping because its a common griefer methodology to kill quest spawns so other players have to wait for a respawn. So, Ive come to use GetFirst/NextObjectinArea for that function.
Its non-persistent, so they can do the quest again after a reset.
This snippet wont compile if you c/p it unless you c/p it into default7 - it does compile but I just wanna see if anyone can spot extraneous issues within as I am monkeying with like, vital organs of the game here, metaphorically speaking.
//:://////////////////////////////////////////////////
//:: NW_C2_DEFAULT7
/*
... more bioware script
*/
// if there is a string variable called KILLQ with a value other than nil
//set on the creature, then killing this creature was part of a quest
//and the quest is incremented by one, via the string value being set as
//a persistant integer on the PC - this script also cross checks a boolean int
//variable on the area called QAREABOO to make sure the character killed the correct
//creature as creatures are reused in different areas
if(GetLocalString(OBJECT_SELF, "KILLQ") == "") return;
object oThisArea = GetArea(OBJECT_SELF);
object oKillQuester = GetFirstObjectInArea(oThisArea);
string sAreaBoolean = "QAREABOO";
int iKill;
while (((oKillQuester) != OBJECT_INVALID) && (GetLocalInt(oThisArea, sAreaBoolean) != 0))
{
if
(GetIsPC(oKillQuester) == TRUE)
{
int iKill = iKill++;
SetLocalInt(oKillQuester, "KILLQ", iKill);
}
else GetNextObjectInArea(oThisArea);
break;
}