Mirage Source http://web.miragesource.net/forums/ |
|
Bounty System (2/5) C & P http://web.miragesource.net/forums/viewtopic.php?f=183&t=4961 |
Page 1 of 80 |
Author: | Nean [ Wed Jan 07, 2009 12:52 am ] |
Post subject: | Bounty System (2/5) C & P |
Ok, so this is just a bounty system I made for the hell of it. Keep in mind I did this, after pulling an all nighter, and was completely exhausted when I wrote most if it, so if you find a mistake, please let me know and don't hold it against me. This feature, will allow users to put hits out on other people, as soon as the hit is put out, the money is subtracted from their inventory. Anyone who kills the person with the price on their head, will receive the money. I also went as far as to include a command which brings up a list of people with bounties, and the price of the bounty on their head (was extremely easy) Credit goes to: William for his TakeGold function, and then the rest of the credit goes to you of MS4, for always answering my questions and helping. Without further adieu: Server Side SPOILER: (click to show)
Client Side SPOILER: (click to show)
This feature gives you two different commands: /bounty (playername) (price of bounty) /bounties (Displays the list of people with prices on their head, and how much) Also it allows you to use two new functions: GetPlayerBounty, and SetPlayerBounty. Have fun. Also, remember to read the code. After all, it will require one or two tweaks, such as replacing the 1's with the number slot that your currency is, etc, etc. That's where the 2/5 comes into play |
Author: | Rory [ Wed Jan 07, 2009 7:51 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
I once worked on a bounty system. And then I reformatted my computer. And then I stopped coding. |
Author: | genusis [ Wed Jan 07, 2009 4:51 pm ] |
Post subject: | Re: Bounty System (2/5) C & P |
this looks very interesting =]. thanks. this could help with making a law system. where if your in an npc range and you steal or something bad you get a bounty put on your head =]. |
Author: | Rian [ Wed Jan 07, 2009 7:37 pm ] |
Post subject: | Re: Bounty System (2/5) C & P |
Nice work Nean. I haven't tested it, but it seems like a solid tutorial. I might even use it if I ever get around to reinstalling Visual Studio |
Author: | Nean [ Wed Jan 07, 2009 7:57 pm ] |
Post subject: | Re: Bounty System (2/5) C & P |
@Rory: I know the feeling, I've had to reinstall VB6 multiple times, it's a pain. @Genusis: Tell me how that works out dude, sounds awesome. @Rian: Sweet, if/when you do so, tell me how it works for you, I have it full implemented and I haven't found any problems, so I hope it's the same for you. |
Author: | genusis [ Wed Jan 07, 2009 10:24 pm ] |
Post subject: | Re: Bounty System (2/5) C & P |
well for the law system all you do is set the npc to have a tile range to where they can see. then you code in a new frm where you can set stuff like the skill theifing or something you want to be considered breaking a rule. then once you set that you then make a npc that is a guard npc<make all guard npc do this> ok for example the rule attacking players in town. place guard npc there and if the code attack player is called send another code doing a search to see if npcs are close enough if not nothing happens to them if so they set a bounty and guard npcs will start to attack them. and if players like kill a bounties player out of the npcs range they get the bounty<or you can set it to have a bounty npc to give players bounties to hunt for in your game. so for this you need to make some code for bounty like what you have there then have it set the bounties if they are breaking a rule in the game. like killing a player near a guard npc or attacking a guard npc. they would get a bounty. you can have the system set anything and everything to certain standards in the game. like opening a chest in front of a guard in a store<stealing crime> the main point would be the npc sight or range and the setting of the rules correctly as well setting the bounty and the rewards given. |
Author: | deathknight [ Wed Jan 07, 2009 10:40 pm ] |
Post subject: | Re: Bounty System (2/5) C & P |
It might also be a good idea to set another variable in the bounty system, to check to see if the bounty was player created, or created by the guards, and if it was created by the guards and the guard kills the player, the bounty goes away. |
Author: | genusis [ Thu Jan 08, 2009 2:21 pm ] |
Post subject: | Re: Bounty System (2/5) C & P |
to me i think a player shouldn't be able to set a bounty on another player unless that player breaks a rule in the game. to make it more fair for the other players, because then there probably be bounties on everyone if they where allowed to freely do that. |
Author: | Lea [ Fri Jan 09, 2009 4:20 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
I say anyone can create a bounty on anyone. Doesn't mean players can legally kill them. |
Author: | Nean [ Fri Jan 09, 2009 4:26 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
genusis wrote: to me i think a player shouldn't be able to set a bounty on another player unless that player breaks a rule in the game. to make it more fair for the other players, because then there probably be bounties on everyone if they where allowed to freely do that. Take this into consideration. A lower level player is going around farming, chilling, generally having a good time. Bam. A higher level comes out of nowhere, and pwns the shit out of them. Tough luck, doubtful any higher level will have any incentive to go kill them as revenge for the other player. With the bounty system implemented, this n00b can exact his/her revenge by using money as the incentive for the more bored players. |
Author: | Coke [ Fri Jan 09, 2009 11:13 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
I haven't read the code so this may be an uninformed comment, but I think a nice implementation of this idea would be to restrict the ability to place bounties. The way I would do it, is allow people to place bounties if the person has killed them, or has killed someone in their guild who is the same rank or lower. Also, perhaps a new npc type that brings up a noticeboard of all current bounties would be a nice expansion. Oh, I'm not requesting this btw, just pooling my thoughts :3 |
Author: | Rory [ Fri Jan 09, 2009 1:05 pm ] |
Post subject: | Re: Bounty System (2/5) C & P |
A good idea would be to only be able to put a bounty as high as you can offer. So if you only have 12gold you can only put a 12gold bounty on the player. Allowing normal players to put bounty on other player's heads. Once they use the command, their money is automatically deducted. |
Author: | Nean [ Fri Jan 09, 2009 8:26 pm ] |
Post subject: | Re: Bounty System (2/5) C & P |
Fox wrote: I haven't read the code so this may be an uninformed comment, but I think a nice implementation of this idea would be to restrict the ability to place bounties. The way I would do it, is allow people to place bounties if the person has killed them, or has killed someone in their guild who is the same rank or lower. Also, perhaps a new npc type that brings up a noticeboard of all current bounties would be a nice expansion. Oh, I'm not requesting this btw, just pooling my thoughts :3 That's a great idea, however would be a little difficult to do. I suppose I could just make a variable when someone kills another person, or something. Yeah, I like the idea of the noticeboard, I don't think it would be too difficult to add either. Thanks for the suggestions, I think I'll try some of them out! Rory wrote: A good idea would be to only be able to put a bounty as high as you can offer. So if you only have 12gold you can only put a 12gold bounty on the player. Allowing normal players to put bounty on other player's heads. Once they use the command, their money is automatically deducted. As it stands now, they can only set a bounty if they have the right money, but I like your idea. However instead of taking all of their money, I was thinking of calculating the price based on the players level. |
Author: | deathknight [ Sat Jan 10, 2009 6:42 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
I like that idea, having it calculated based on the players level, but I think it would be fun to make that a minimum. Also it would be interesing to add in 2 more commands, a cancel bounty command (get your gold back minus a certain percent I.e. bounty of 100 gold, you cancel get 90 back). And an add on to bounty command, so that if no one wants to kill that person for that money, you can increase it to create a better incentive, or someone else can add their money to the bounty to create more of an incentive. |
Author: | timster0 [ Sun Jan 11, 2009 11:05 pm ] |
Post subject: | Re: Bounty System (2/5) C & P |
OMG! Thank you! Very nice tut! |
Author: | timster0 [ Wed Jan 14, 2009 12:41 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
Well, I tried it out and GetPlayerBounty is int defined. |
Author: | Nean [ Wed Jan 14, 2009 1:10 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
timster0 wrote: Well, I tried it out and GetPlayerBounty is int defined. Find: Code: Sub SetPlayerName(ByVal index As Long, _ ByVal Name As String) Player(index).Char(TempPlayer(index).CharNum).Name = Name End Sub Under it add: Code: Function GetPlayerBounty(ByVal index As Long) As String
GetPlayerBounty = Val(Player(index).Char(TempPlayer(index).CharNum).Bounty) End Function Sub SetPlayerBounty(ByVal index As Long, _ ByVal Bounty As Long) Player(index).Char(TempPlayer(index).CharNum).Bounty = Bounty End Sub |
Author: | timster0 [ Wed Jan 14, 2009 1:20 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
Works perfectly now, thanks. |
Author: | Nean [ Wed Jan 14, 2009 1:25 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
timster0 wrote: Works perfectly now, thanks. You're welcome. |
Author: | wanai [ Sat Jan 01, 2022 8:22 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
Cora |
Author: | wanai [ Sat Jan 01, 2022 8:24 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
72.2 |
Author: | wanai [ Sat Jan 01, 2022 8:25 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
Bett |
Author: | wanai [ Sat Jan 01, 2022 8:26 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
Bett |
Author: | wanai [ Sat Jan 01, 2022 8:27 am ] |
Post subject: | Re: Bounty System (2/5) C & P |
John |
Page 1 of 80 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |