Author Topic: Ideas to alert player from a pick pocket?  (Read 364 times)

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Ideas to alert player from a pick pocket?
« on: November 26, 2014, 04:40:38 pm »


               

I have in my pw a system that allows victim to kill thief if he stole an item. I'm not too happy about it because there is not even a warning that this thief stole something and can be killed without causing any consequence of PK (player kill).


 


Any idea?



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Ideas to alert player from a pick pocket?
« Reply #1 on: November 27, 2014, 09:42:16 am »


               

Are you asking for an alternative?


I believe GetItemDisturbedType is able to distinguish between dropping an item and an item being stolen / pickpocket


 


With that in mind, you could make it so players can set themselves as 'Pickpocket-able or not' 


If they are NOT pickpocketable - you could probably just return the item to the person inventory.


 


http://www.nwnlexico...tle=OnDisturbed


 


This says that on pickpocket, the onDisturbed event fires.


Players dont typically have one of these events, but you might be able to still use the GetItemDisturbedType function from the 


http://www.nwnlexico...OnUnAcquireItem


 


If you can detect the item being removed / stolen from that event, then you can return it to the player - in effect blocking the pickpocket attempt


 


The only true way to block it, would be to use nwnx and use an event hook.



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Ideas to alert player from a pick pocket?
« Reply #2 on: November 27, 2014, 03:41:49 pm »


               

Are you asking for an alternative?

I believe GetItemDisturbedType is able to distinguish between dropping an item and an item being stolen / pickpocket

 

With that in mind, you could make it so players can set themselves as 'Pickpocket-able or not' 

If they are NOT pickpocketable - you could probably just return the item to the person inventory.

 
http://www.nwnlexico...tle=OnDisturbed

 

This says that on pickpocket, the onDisturbed event fires.

Players dont typically have one of these events, but you might be able to still use the GetItemDisturbedType function from the 
http://www.nwnlexico...OnUnAcquireItem

 

If you can detect the item being removed / stolen from that event, then you can return it to the player - in effect blocking the pickpocket attempt

 

The only true way to block it, would be to use nwnx and use an event hook.



 

thanks for reply, Baaleos.

 

I am using this piece of code in module event onitemunacquired:

 



object oItem = GetModuleItemLost();
object oVictim = GetModuleItemLostBy();
object oPossessor = GetItemPossessor(oItem);

int iStackSize = GetItemStackSize(oItem);
string sStackSize = IntToString(iStackSize);

if(!GetIsPC(oVictim)) return;
if(!GetIsObjectValid(oItem)) return;

if(GetIsPC(oPossessor)) //pp (Pick Pocket)
{
    SetPersistentInt(oPossessor, "pp", 1);

    WriteTimestampedLogEntry("Inventory Alert] The character " + GetName(oPossessor) + " (" + GetPCPlayerName(oPossessor) + ") stole item " + GetName(oItem) + " (" + sStackSize + ") from " + GetName(oVictim) + " (" + GetPCPlayerName(oVictim) + ") in area " + GetName(GetArea(oVictim)) + ".");

the variable int "pp" makes the player thief vulnerable to die without making killer receive PK status * once time - ondeathevent we delete this variable "pp"


 


I don't want to block pick pocket, but give benefit to victim.


 


what do you think?



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Ideas to alert player from a pick pocket?
« Reply #3 on: November 27, 2014, 09:41:23 pm »


               But if a player traded an item using the trade window - wouldnt that fire the script and be detected as a pickpocket?

Your script seems to be thinking that if the Item goes straight from person1 to person2 without going on the ground first, then it must be a pickpocket.
               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Ideas to alert player from a pick pocket?
« Reply #4 on: November 28, 2014, 12:08:13 am »


               

The variable PP allows the victim to kill the thief without getting PK and recover the stolen items.


 




But if a player traded an item using the trade window - wouldnt that fire the script and be detected as a pickpocket?


Your script seems to be thinking that if the Item goes straight from person1 to person2 without going on the ground first, then it must be a pickpocket.




 


Not really.  If player use bartler the item will first be unacquired before completing the trade, oPossessor will not be a PC


 


if(GetIsPC(oPossessor)) works as well  '<img'>


 


 


What can I add extra in my on pickpocket code? Do you have any idea of something that is interesting beyond makes thief variable PP?



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Ideas to alert player from a pick pocket?
« Reply #5 on: November 28, 2014, 12:26:29 am »


               Sorry- I think I was unclear.
When I mentioned trading, I meant when a player initiates a trade with another player.

Eg: Player Opens Barter window with another player.

This would allow the item to travel from one inventory to the other, meaning that oPossessor would be the new player.


In terms of things you can add - Since you have a reference to the thief, you could create a system where the victim can hire bounty hunters to search for the thief and take back the item?
               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Ideas to alert player from a pick pocket?
« Reply #6 on: November 28, 2014, 12:58:06 am »


               


In terms of things you can add - Since you have a reference to the thief, you could create a system where the victim can hire bounty hunters to search for the thief and take back the item?




 


Thanks giving me that idea. 


 


Hmm... The victim doesn't know who is the thief because thief is hidden/invisible. I thought send to victim a floating message "You were stolen!" when stolen, but also the issue that the victim doesn't realize that it happened (that was stolen)


 


The rogue is delicate, he gradually steals all the items from the inventory of victim and the victim does not know whats happening, unless victim see your history of lost items.


               
               

               


                     Modifié par WhiteTiger, 28 novembre 2014 - 02:33 .
                     
                  


            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Ideas to alert player from a pick pocket?
« Reply #7 on: November 28, 2014, 09:22:29 am »


               

How about storing the item that was stolen as a persistent variable too?


Instead of sending bounty hunters after the thief - send them out into the world to re-acquire the item - but they have to pay expenses in order to get the item back,


 


Eg: The item is marked as 'being sought after'


If the thief sells it to merchants - the item can then be re-acquired by the victim.


 


Or - Bounty Hunters will track down whoever has the item, and try to take it from their corpse