160 lines
5.4 KiB
Plaintext
160 lines
5.4 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Name s_itemacquired
|
|
//:: Copyright (c) 2001 Bioware Corp.
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
|
|
This script is intended to be called by or incorporated into the
|
|
Module:OnAcquireItem event (script). It works in conjuction with
|
|
s_cleartrash by clearing the destruct time on items picked up by PC's
|
|
so they will not near-instantly be destroyed if dropped. Once dropped,
|
|
however, they will be marked for destruction by s_cleartrash.
|
|
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Scott Thorne (Thornex2@wans.net)
|
|
//:: Created On: July 27, 2002
|
|
//:://////////////////////////////////////////////
|
|
|
|
//#include "i_tagtests"
|
|
#include "pws_nodropunique"
|
|
#include "nw_i0_plot"
|
|
|
|
void main()
|
|
{
|
|
|
|
object oItem = GetModuleItemAcquired();
|
|
|
|
if (GetIsPC(GetItemPossessor(oItem)))
|
|
{
|
|
DeleteLocalInt(oItem, "CT_DESTRUCT_TIME_FIX");
|
|
}
|
|
//CheckForUnique();
|
|
|
|
// Script made by Lucilius
|
|
|
|
//START OF CUT
|
|
object oItemGained = GetModuleItemAcquired();
|
|
object oGiver = GetModuleItemLostBy();
|
|
object oReceiver = GetItemPossessor(oItemGained);
|
|
string sItemGained = GetResRef(oItemGained);
|
|
string oName = GetName(oReceiver);
|
|
int nCursed = GetItemCursedFlag(oItemGained);
|
|
|
|
if (GetIsDM(oReceiver))
|
|
{
|
|
//AssignCommand(oReceiver, ActionSpeakString("Anti-Pickpocket DM Exclude", TALKVOLUME_SHOUT));
|
|
}
|
|
else if(nCursed == TRUE)
|
|
{
|
|
//AssignCommand(oReceiver, ActionSpeakString("Anti-Pickpocket Recent Unequip Exclude", TALKVOLUME_SHOUT));
|
|
}
|
|
else if(GetLocalInt(oItemGained, "recentunequip") == TRUE)
|
|
{
|
|
//AssignCommand(oReceiver, ActionSpeakString("Anti-Pickpocket Recent Unequip Exclude", TALKVOLUME_SHOUT));
|
|
}
|
|
else if(GetLocalInt(oItemGained, "ZEP_CR_TEMPITEM") == TRUE)
|
|
{
|
|
//AssignCommand(oReceiver, ActionSpeakString("ZEP Exclude", TALKVOLUME_SHOUT));
|
|
}
|
|
else if(GetBaseItemType(oItemGained) == BASE_ITEM_TRAPKIT)
|
|
{
|
|
//AssignCommand(oReceiver, ActionSpeakString("ZEP Exclude", TALKVOLUME_SHOUT));
|
|
}
|
|
|
|
else if (GetIsPC(oReceiver))
|
|
{
|
|
//AssignCommand(oReceiver, ActionSpeakString("Anti-Pickpocket Is PC Include", TALKVOLUME_SHOUT));
|
|
if(GetStolenFlag(oItemGained)==TRUE)
|
|
{
|
|
//ActionSpeakString("Anti-Pickpocket Running Payload", TALKVOLUME_SHOUT);
|
|
SendMessageToPC(oReceiver, "Pickpocket is disabled on this server.");
|
|
//Start Klarth's modifications.
|
|
SendMessageToPC(oGiver, "Warning! Someone has just attempted to pickpocket you!");
|
|
SendMessageToAllDMs("PICKPOCKET Detected : " + oName);
|
|
object oReceiver = GetItemPossessor(oItemGained);
|
|
effect eTag = EffectVisualEffect(VFX_DUR_FLAG_PURPLE);
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eTag, oReceiver);
|
|
// End Klarth's modifications.
|
|
SetItemCursedFlag(oItemGained, FALSE);
|
|
SetStolenFlag(oItemGained, FALSE);
|
|
DestroyObject(oItemGained);
|
|
if (GetIsPC(oGiver))
|
|
{
|
|
CreateItemOnObject(sItemGained, oGiver, 1);
|
|
}
|
|
}
|
|
}
|
|
//END OF CUT
|
|
|
|
|
|
// Send comand to check if itm is unique
|
|
// CheckForUnique();
|
|
|
|
/*lore, no drop Cohs bit if thorns goes tits up
|
|
object oItemGot = GetModuleItemAcquired();
|
|
object oAcquirer = GetItemPossessor(oItem);
|
|
|
|
if (GetIsNoDrop(oItemGot))
|
|
ExecuteScript("s_nodrop_pickup", oAcquirer);
|
|
|
|
if (GetIsLore(oItemGot))
|
|
ExecuteScript("s_lore_pickup", oAcquirer);
|
|
*/
|
|
|
|
//:://Tell what was got
|
|
object oItemObtained = GetModuleItemAcquired();
|
|
//object oItemPCGot = GetModuleItemAcquiredBy();
|
|
object oItemPCGot = GetItemPossessor(oItemObtained);
|
|
string oItemName = GetName(oItemObtained);
|
|
string oPCName = GetName(oItemPCGot);
|
|
|
|
//if (GetIsPC(GetItemPossessor(oItemGot)))
|
|
FloatingTextStringOnCreature(oPCName + " Acquired " + oItemName, oItemPCGot);
|
|
|
|
if (GetIsPC(oReceiver))
|
|
{
|
|
// if (GetStringLeft(sItemGained, 9) == "kelobject")
|
|
// {
|
|
// SetItemCursedFlag(oItem, TRUE);
|
|
// SetPlotFlag(oItem, TRUE);
|
|
// }
|
|
if (GetStringLeft(sItemGained, 9) == "rcq_item_")
|
|
{
|
|
SetItemCursedFlag(oItem, TRUE);
|
|
SetPlotFlag(oItem, TRUE);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
//the following is added to make sure that only 1 shadowjump tool per person
|
|
//when they try and acquire a second it will be deleted.
|
|
string jItem = GetTag(oItem);
|
|
if (jItem == "leo_shadowjump"){
|
|
object oPlayer = GetItemPossessor(oItem);
|
|
int shadowjumpCount = GetNumItems(oPlayer, jItem);
|
|
if (shadowjumpCount > 1){
|
|
SendMessageToPC(oPlayer, "Only 1 Shadowjump tool per person!!!");
|
|
int jumpValue = GetGoldPieceValue(oItem);
|
|
GiveGoldToCreature(oPlayer, jumpValue);
|
|
DestroyObject(oItem);
|
|
}
|
|
}
|
|
|
|
//the following is added to make sure that only 1 bindstone tool per person
|
|
//when they try and acquire a second it will be deleted.
|
|
string bItem = GetTag(oItem);
|
|
if (bItem == "em_bindstone"){
|
|
object oPlayer = GetItemPossessor(oItem);
|
|
int bindstoneCount = GetNumItems(oPlayer, bItem);
|
|
if (bindstoneCount > 1){
|
|
SendMessageToPC(oPlayer, "Only 1 bindstone per person!!!");
|
|
int bindValue = GetGoldPieceValue(oItem);
|
|
GiveGoldToCreature(oPlayer, bindValue);
|
|
DestroyObject(oItem);
|
|
}
|
|
}
|
|
}
|