Mirage Source

Free ORPG making software.
It is currently Sat Apr 27, 2024 5:31 pm

All times are UTC




Post new topic Reply to topic  [ 46 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Pick Pocket
PostPosted: Mon Oct 02, 2006 8:00 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
I have an idea for a pick pocketing system, but I was wondering if anyone would have any suggestions on how to work the code.

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 02, 2006 9:35 pm 
Offline
Knowledgeable

Joined: Fri Aug 25, 2006 6:40 pm
Posts: 132
you could work the code by going though the npcs.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 11:07 am 
Offline
Regular

Joined: Fri Aug 25, 2006 8:39 pm
Posts: 66
What do you mean, have a sort of set like p2ptrading(for npcs)you click a little button and he'll pickpocket someone... something like that? or are you talking about pickpocketing other players?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 11:23 am 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
Well my idea is to have both, "rob" npc and "PickPocket" players, now the big idea about the pickpocket players is that it does "NOT" take the item away from the origanal player. here's an example
:::::::::::::::Example:::::::::::::::::
1. player trys to pickpocket another player
2. player is successful at sneaking into the pocket
3. "player picks a item to steal"
4. Players 10 - 100% chance of being spotted is called!
5. The item that he actually gets is based on his pick pocket skill
6. If player is successful add item to inventory
7. (other option) If player is caught deal 15 damage to the player pickpocketing - don't add the item to his inventory; adds the title of theif at the end of his name
::::::::::::End Example:::::::::::::

And for the npc's
:::::::::::::::::Example:::::::::::::::::
1. player trys to rob a npc
2. player is successful at sneaking into a crate/bag
3. "player picks item to streal"
4. Platers 10 - 100% chance of being spotted is called!
5. the item that he actually gets is based on his stealing skill(aka pickpocket)
6. If player is successful add item to inventory
7.(other option) If player is caught deal 15 damage to the player and send to jail - don't add the item to his inventory; remove the worth of the item trying to steal from players gold: (if player does not have the cash leave him in a cell for 5 minutes) Add the title theif to the end of his name.
:::::::::::::::::::::::::End Example::::::::::::::::::::::
I'm not sure if that's possible to be done, but that's sort of what I'm looking for. any suggestions on how to do that?

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 12:21 pm 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
Player
Could be pretty advanced, but still there are a very easy way to do this. Just follow the attack player code. And you can basicly just make it so you steal gold from the player, the amount depending on your skill.

NPCs
This is a little bit more difficult, still pretty easy if you just want to take gold. But if you want to scam for items, you would need to add a lot of things, both to the editNPC and also the actual NPC inventory.

I suggest you go with the scam for gold idea :P

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 12:46 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
Either way I'm doing the gold thing, I was just wanting to get some examples or idea's for doing it, but I want the stealing actual items from npc's for the realism of it, and stealing from players just for fun. but I would rather it be regular items+gold then just gold.

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 1:27 pm 
Offline
Pro

Joined: Mon May 29, 2006 2:15 am
Posts: 368
You should probably add another Byte val to the itemrec, like StealVal or something, so if you were trying to pick-pocket a player, the higher the StealVal, the harder/longer it is to steal.

_________________
Image
Image
The quality of a man is not measured by how well he treats the knowledgeable and competent, but rather how he treats those less fortunate than himself.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 1:47 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
Even though I'm trying to work out how to do the pick pocket, I'm currently working out a in client editable class thingy(like editing npcs but classes) and back and fourth trying to figure this out. I think I'm going to take your idea and add a stealval to the items, and a robbedval to npc's and players rec's

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 3:47 pm 
Offline
Knowledgeable
User avatar

Joined: Mon May 29, 2006 11:38 am
Posts: 293
Location: Cambridge, UK
i found this in my documents last night, no idea where it came from or if its even MS compatible i just saw some bits and thought meh, you mike like this

Code:
PickPocket skill

Sub Commands(Index)
' Place code in here for scripted commands
Dim Name
Dim Index2
Dim V
Dim T
Dim V2
Dim T2
Dim G
Dim S
Dim N

If LCase(Mid(GetPlayerStringCommand(Index), 1, 11)) = "/pickpocket" Then
If Len(GetPlayerStringCommand(Index)) < 13 Then
Call PlayerMsg(Index, "What? Whose that?", 15)
Exit Sub
End If
'first we check to see if they're of the thief class
If GetPlayerClass(Index) <> 0 Then
Call PlayerMsg(Index, "Pfft, you're not a thief!", 12)
Exit Sub
End If
'Lets see if they have a pickpocketing kit, if not, no go.
If HasItem(Index, 10) Then

Name = Mid(GetPlayerStringCommand(Index), 13, Len(GetPlayerStringCommand(Index)) - 12)
Index2 = FindPlayer(Name)

If Index2 > 0 Then
'Check to make sure they're next to the person
  If GetPlayerMap(Index) <> GetPlayerMap(Index2) Then
     Call PlayerMsg(Index, "You're no where near this person!", 15)
     ExitSub
  End If
  Select Case GetPlayerDir(Index)
  Case 0
  If GetPlayerX(Index2) <> GetPlayerX(Index) Then
Call PlayerMsg(Index, "You gotta get a little closer...", 15)
Exit Sub
End If
  If GetPlayerY(Index2) <> GetPlayerY(Index) - 1 Then
Call PlayerMsg(Index, "You gotta get a little closer...", 15)
Exit Sub
End If
  Case 1
  If GetPlayerX(Index2) <> GetPlayerX(Index) Then
Call PlayerMsg(Index, "You gotta get a little closer...", 15)
Exit Sub
End If
  If GetPlayerY(Index2) <> GetPlayerY(Index) + 1 Then
Call PlayerMsg(Index, "You gotta get a little closer...", 15)
Exit Sub
End If
  Case 2
  If GetPlayerX(Index2) <> GetPlayerX(Index) - 1 Then
Call PlayerMsg(Index, "You gotta get a little closer...", 15)
Exit Sub
End If
  If GetPlayerY(Index2) <> GetPlayerY(Index) Then
Call PlayerMsg(Index, "You gotta get a little closer...", 15)
Exit Sub
End If
  Case 3
  If GetPlayerX(Index2) <> GetPlayerX(Index) + 1 Then
Call PlayerMsg(Index, "You gotta get a little closer...", 15)
Exit Sub
End If
  If GetPlayerY(Index2) <> GetPlayerY(Index) Then
Call PlayerMsg(Index, "You gotta get a little closer...", 15)
Exit Sub
End If
  End Select  

'These are success chances based on speed, change these at will
'We'll call this the thief's skills
T = Int(GetPlayerSpeed(Index) / 5)
T2 = Int(Rnd * GetPlayerLevel(Index)) + T
'And this will be the victims dodge chance
V = Int(GetPlayerSpeed(Index2) / 5)
V2 = Int(Rnd * GetPlayerLevel(Index2)) + V

If V2 > GetPlayerLevel(Index2) * 2 Then V2 = GetPlayerLevel(Index2) * 2
If T2 > GetPlayerLevel(Index) * 2 Then T2 = GetPlayerLevel(Index) * 2
'This will measure how much gold to take, change this to fit your game
G = Int(Rnd * 100) * Int(GetPlayerLevel(Index2) / 5)
'Just a few numeric triggers  S = slot, N = number
S = 0
N = 0

'This finds the slot with the gold
Do
 S = S + 1
 If GetPlayerInvItemNum(Index2, S) = 1 Then N = 1
 Loop Until N = 1 or S = 101

'If the player doesnt have gold, then you cant steal it!
If S < 1 or S > 100 Then
  Call PlayerMsg(Index, "This guy doesnt have anything to steal!", 15)
  Exit Sub
End If

'If the Victim is better than the thief...
If V2 > T2 Then
  Call PlayerMsg(Index, "You've failed! Get Out of here before you're caught!", 12)
  Call PlayerMsg(Index2, GetPlayerName(Index) & " has just attempted to steal your cash!", 14)
Exit Sub
End If

'If it was a close one?
If T2 = V2 Then
  Call PlayerMsg(Index, "You missed, but they dont seem to have noticed...", 14)
Exit Sub
End If

'If the thief Succeeds!
If T2 > V2 Then
  If HasItem(Index2, 1) Then
  If GetPlayerInvItemValue(Index2, S) < G Then G = GetPlayerInvItemValue(Index2, S) - 1
  'Call SetPlayerInvItemValue(Index2, S, GetPlayerInvItemValue(Index2, S) - G)
  Call GiveItem(Index, 1, G)
  Call TakeItem(Index2, 1, G)
  Call PlayerMsg(Index, "Yes! You got the loot, now scram!", 11)
  End If
End If
Else
Call PlayerMsg(Index, "Wha?... There's No one here...", 15)
  Exit Sub
End If
Else
Call PlayerMsg(Index, "You're ill equipped for this!", 14)
End If
End If
'The end of the thief portion...


End Sub

_________________
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 4:10 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
Ok I'll try that out with some stuff, thanks for the assist, if you come up with any ideas or helpful code hints please post.

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 6:40 am 
Offline
Newbie

Joined: Fri Sep 29, 2006 6:39 am
Posts: 20
considering that is just script, I don't believe it will work, atleast not without modifying it quite a bit....It is a nice base to use though.
as for where it came from I believe i seen it on a closed source engine.....


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 8:32 am 
Offline
Knowledgeable
User avatar

Joined: Mon May 29, 2006 11:38 am
Posts: 293
Location: Cambridge, UK
As i said, i just found it :S realy confused me xD.

_________________
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 2:06 pm 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
It doesn't work. It uses functions that does not exist, and it also has a few errors in it. But its a decent start.

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 3:00 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
I think P2P pickpocketing is really bad news, but pickpocketing NPC's could easily be done. Just copy the drop item code, but instead of when the NPC dies, when he is pickpocketeted(sp?). You could even add levels to the playerrec and make it more advanced. As for the packets, again, pretty easy. Send a request to the server, server does all calculations and then gives the player the item, and even send a message. Results in what... 2-3 packets? Easy peasy lemon squeazy.

~Kite

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 3:37 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
Well, I have sort of what I'm wanting to do, but I was wondering how I would make the npc's inventory(because I have a certain way I'm going to do this.) Also I'm confused on how to make it so that when you click ctrl it brings up the inventory rather than wack the player with your sword,axe or w/e.

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 4:19 pm 
Offline
Newbie

Joined: Fri Sep 29, 2006 6:39 am
Posts: 20
I suggest choosing a new key,


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 3:22 pm 
Offline
Regular

Joined: Fri Aug 25, 2006 8:39 pm
Posts: 66
I know this is a fairly old topic, but which of the attacking things should be duplicated(I'm trying to make a pickpocket myself)
here's a list
1. CanAttackPlayer
2. CanAttackNpc
3. CannpcAttackPlayer
4. AttackPlayer
5. NpcAttackPlayer
6. AttackNpc

Where is the thing that makes the "Ctrl" Key actually use the attack buttons? could someone help me I'm clueless.
?Please help out some?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 3:34 pm 
HandleKeyPresses or something like that, I think.


Top
  
 
 Post subject:
PostPosted: Wed Oct 25, 2006 12:56 am 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
It's not in handlekeypresses, it's somewhere else, assuming you can find it, but if you don't wanna look I think it's in modGlobals under ' Game Direction Vars

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 25, 2006 1:17 am 
HandleKeyPresses handles all the pressing of keys in Mirage, I havn't opened it up, but I'm pretty sure it handles it there, since it handles what happens when you press enter to pick up an item and such.

[EDIT] Guess I was wrong. I finally stopped being lazy, and actually opened my source and looked in handlekeypresses, I will now look for the correct location.

[EDIT 2] I think it is this code:

Code:
            If KeyCode = vbKeyControl Then
                ControlDown = True
            End If


In:

Code:
Sub CheckInput(ByVal KeyState As Byte, ByVal KeyCode As Integer, ByVal Shift As Integer)


Though, I'm prolly wrong. Dunno.


Top
  
 
 Post subject:
PostPosted: Wed Oct 25, 2006 1:35 am 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
I think it might be, I'm not really sure though.

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 25, 2006 1:38 am 
I checked, that is where it sets attacking to true, then runs a check for everything dealing with it, then proceeds to attack.


Top
  
 
 Post subject:
PostPosted: Wed Oct 25, 2006 1:39 am 
Offline
Regular

Joined: Fri Aug 25, 2006 8:39 pm
Posts: 66
Ok I will experiment with it over some time and figure out what I'm doing.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 25, 2006 12:34 pm 
Offline
Regular

Joined: Mon May 29, 2006 6:04 pm
Posts: 66
i woudl suggest raskingthe player which woudl they like to do..
or
setup an option for the pickpocket class to always attempt to
pick pockets when on and always attack when off
place a simple check in the attack sub to see if they have it set on if so
then send the target info to the pickpocket sub and activate it that way..

i could get into more detail but it seems you have enough info for now..
i may be able to help out a bit more later..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 2:17 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
checkinput and gameloop house the code which checks if a button (such as ctrl, up, down etc.) is being pressed, whereas HandleKeyPresses is all the chat keys, such as A, B, Backspace, enter etc. keys are handled.

-Kite-

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 46 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group