generated from Jaysyn/ModuleTemplate
123 lines
4.1 KiB
Plaintext
123 lines
4.1 KiB
Plaintext
|
|
|
|
#include "omw_plns"
|
|
|
|
|
|
#include "nw_i0_plotwizard"
|
|
void main()
|
|
{
|
|
// PLOT WIZARD MANAGED CODE BEGINS
|
|
PWSetMinLocalIntAndJournalForItemAcquired("p000state", "p000", 2, "NW_IT_MPOTION005", 200);
|
|
// PLOT WIZARD MANAGED CODE ENDS
|
|
|
|
RunLootNotificationOnAcquire();
|
|
|
|
|
|
//::///////////////////////////////////////////////
|
|
//:: Name Lootable Module on acquired script
|
|
//:: FileName loot_acquired
|
|
//:: Copyright (c) 2001 Bioware Corp.
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Sentur Signe
|
|
//:://////////////////////////////////////////////
|
|
// add this script to the module on acquired event, or
|
|
// modify your own script to feature these few lines.
|
|
|
|
|
|
//Credit to pulse cap, and _martigan_ , I used pulse's changes only as I dislike that IPGetIsMeleeWeapon()
|
|
//Will return anything between a Greatsword, and a dagger. A dagger, I can see a thief nabbing.
|
|
|
|
{
|
|
object oItem =GetModuleItemAcquired();
|
|
|
|
if (
|
|
GetBaseItemType(oItem)==BASE_ITEM_ARMOR||
|
|
GetBaseItemType(oItem)==BASE_ITEM_BASTARDSWORD||
|
|
GetBaseItemType(oItem)==BASE_ITEM_BATTLEAXE||
|
|
GetBaseItemType(oItem)==BASE_ITEM_BOOTS||
|
|
GetBaseItemType(oItem)==BASE_ITEM_DIREMACE||
|
|
GetBaseItemType(oItem)==BASE_ITEM_DOUBLEAXE||
|
|
GetBaseItemType(oItem)==BASE_ITEM_DWARVENWARAXE||
|
|
GetBaseItemType(oItem)==BASE_ITEM_GREATAXE||
|
|
GetBaseItemType(oItem)==BASE_ITEM_GREATSWORD||
|
|
GetBaseItemType(oItem)==BASE_ITEM_HALBERD||
|
|
GetBaseItemType(oItem)==BASE_ITEM_HEAVYCROSSBOW||
|
|
GetBaseItemType(oItem)==BASE_ITEM_HEAVYFLAIL||
|
|
GetBaseItemType(oItem)==BASE_ITEM_HELMET||
|
|
GetBaseItemType(oItem)==BASE_ITEM_KATANA||
|
|
GetBaseItemType(oItem)==BASE_ITEM_LARGESHIELD||
|
|
GetBaseItemType(oItem)==BASE_ITEM_LIGHTCROSSBOW||
|
|
GetBaseItemType(oItem)==BASE_ITEM_LONGBOW||
|
|
GetBaseItemType(oItem)==BASE_ITEM_LONGSWORD||
|
|
GetBaseItemType(oItem)==BASE_ITEM_MAGICSTAFF||
|
|
GetBaseItemType(oItem)==BASE_ITEM_QUARTERSTAFF||
|
|
GetBaseItemType(oItem)==BASE_ITEM_RAPIER||
|
|
GetBaseItemType(oItem)==BASE_ITEM_SCYTHE||
|
|
GetBaseItemType(oItem)==BASE_ITEM_SHORTBOW||
|
|
GetBaseItemType(oItem)==BASE_ITEM_SMALLSHIELD||
|
|
GetBaseItemType(oItem)==BASE_ITEM_TOWERSHIELD||
|
|
GetBaseItemType(oItem)==BASE_ITEM_TWOBLADEDSWORD||
|
|
GetBaseItemType(oItem)==BASE_ITEM_WARHAMMER||
|
|
GetWeight(oItem) >= 30
|
|
)
|
|
{
|
|
SetPickpocketableFlag(oItem, FALSE);
|
|
}
|
|
}
|
|
|
|
|
|
{
|
|
object oItem = GetModuleItemAcquired();
|
|
|
|
if (GetIsPC(GetItemPossessor(oItem)))
|
|
{
|
|
SetLocalInt(oItem, "PCItem", 1);
|
|
}
|
|
{
|
|
object oItem = GetModuleItemAcquired();
|
|
object oPC = GetItemPossessor(oItem);
|
|
object oSource = GetModuleItemAcquiredFrom();
|
|
string sPCCDKey = GetPCPublicCDKey(oPC);
|
|
string sPCName = GetName(oPC);
|
|
string sSavedName = GetLocalString(oItem, sPCCDKey);
|
|
|
|
|
|
// if its not a pc, ignore it.
|
|
if (!GetIsPC(oPC)) return;
|
|
|
|
|
|
// We have to let stacked items get by. It's too wiggy otherwise
|
|
if (GetItemStackSize(oItem) > 1) return;
|
|
|
|
// this player has never touched this item, so mark it
|
|
// also, I trust my DMs, so if the helper is a DM, remark
|
|
// the item for the new character
|
|
if(sSavedName=="" || GetIsDM(oSource) || GetIsDMPossessed(oSource))
|
|
{
|
|
SetLocalString(oItem, sPCCDKey, sPCName); return;
|
|
}
|
|
|
|
// It's ok to sell an item, and then buy it with a different character
|
|
if(GetObjectType(oSource) == OBJECT_TYPE_STORE)
|
|
{
|
|
CopyItem(oItem, oPC); // copy the item in the player's inventory
|
|
DestroyObject(oItem,0.1); // destroy the old item, and all the variables on it
|
|
// note: the CopyItem should make this script fire again, marking the new item
|
|
return;
|
|
}
|
|
|
|
// It is not ok to pass an item directly or indirectly between
|
|
// one player's different characters
|
|
if(sPCName!=sSavedName)
|
|
{
|
|
string sHelper = GetName(oSource);
|
|
string sHelperKey = GetPCPublicCDKey(oSource);
|
|
DestroyObject(oItem,0.1);
|
|
SendMessageToPC(oPC,"Trading items between your own characters is not allowed on the Stone.");
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|