Link Posted April 18, 2013 Author Share Posted April 18, 2013 So there are some people who are wondering how to get items dropped on death, but they'd like the more valuable items not to be dropped. Small tutorial here showing just how that's done. This tutorial makes it so that every item is dropped on death besides the two items that are the most valuable in your inventory. Also basically if you kill another player or they're killed you can steal their items.Feel free to make additions or notify me of bugs.This will all be server sided, so go to **modPlayer** and ctrl + F(quick search) **Sub OnDeath(ByVal index As Long)** below where it says **Call SetPlayerVital(index, Vitals.HP, 0)**If you still have this code :```' drop all worn itemsFor i = 1 To Equipment.Equipment_Count - 1If GetPlayerEquipment(index, i) > 0 ThenPlayerMapDropItem index, GetPlayerEquipment(index, i), 0End IfNext```**You can replace it with the following code:**```'Brigz's EDITDim ValuedItem(1 To 3) As ByteDim Value As LongFor i = 1 To MAX_INVIf GetPlayerInvItemNum(index, i) > 0 ThenIf Item(GetPlayerInvItemNum(index, i)).price > 0 ThenIf Item(GetPlayerInvItemNum(index, i)).price >= Value ThenValuedItem(3) = ValuedItem(2)ValuedItem(2) = ValuedItem(1)ValuedItem(1) = iValue = Item(GetPlayerInvItemNum(index, i)).priceEnd IfEnd IfEnd IfNext i'Drop inventory itemsFor i = 1 To MAX_INVIf i <> ValuedItem(1) And i <> ValuedItem(2) And i <> ValuedItem(3) ThenPlayerMapDropItem index, i, GetPlayerInvItemValue(index, i)End IfNext'Send all equiped items to the inventory to be dumped.For i = 1 To Equipment.Equipment_Count - 1If GetPlayerEquipment(index, i) > 0 ThenPlayerMapDropItem index, GetPlayerEquipment(index, i), 0End If'Send WeaponGiveInvItem index, GetPlayerEquipment(index, Weapon), 0SetPlayerEquipment index, 0, Weapon'Send ArmorGiveInvItem index, GetPlayerEquipment(index, Armor), 0SetPlayerEquipment index, 0, Armor'Send ShieldGiveInvItem index, GetPlayerEquipment(index, Shield), 0SetPlayerEquipment index, 0, Shield'Send HelmetGiveInvItem index, GetPlayerEquipment(index, Helmet), 0SetPlayerEquipment index, 0, HelmetNext'Drop *equipped* inventory itemsFor i = 1 To MAX_INVIf Not i = ValuedItem(1) And i <> ValuedItem(2) And i <> ValuedItem(3) Then PlayerMapDropItem index, i, 0Next```That's it**=========================================== Other Wise===============================================================**Now on the other hand, you may have a code that looks like this:```'Drop inventory items, Will make this only apply to player killers.If GetPlayerPK(index) = YES ThenFor i = 1 To MAX_INVPlayerMapDropItem index, i, GetPlayerInvItemValue(index, i)Next'Send all equiped items to the inventory to be dumped.For i = 1 To Equipment.Equipment_Count - 1If GetPlayerEquipment(index, i) > 0 ThenPlayerMapDropItem index, GetPlayerEquipment(index, i), 0End If'Send WeaponGiveInvItem index, GetPlayerEquipment(index, Weapon), 0SetPlayerEquipment index, 0, Weapon'Send ArmorGiveInvItem index, GetPlayerEquipment(index, Armor), 0SetPlayerEquipment index, 0, Armor'Send ShieldGiveInvItem index, GetPlayerEquipment(index, Shield), 0SetPlayerEquipment index, 0, Shield'Send HelmetGiveInvItem index, GetPlayerEquipment(index, Helmet), 0SetPlayerEquipment index, 0, HelmetNext'Drop *equipped* inventory itemsFor i = 1 To MAX_INVPlayerMapDropItem index, i, 0NextEnd If```If you have a code like this you can replace it with the same thing I posted before which, again, is this:```'Brigz's EDITDim ValuedItem(1 To 3) As ByteDim Value As LongFor i = 1 To MAX_INVIf GetPlayerInvItemNum(index, i) > 0 ThenIf Item(GetPlayerInvItemNum(index, i)).price > 0 ThenIf Item(GetPlayerInvItemNum(index, i)).price >= Value ThenValuedItem(3) = ValuedItem(2)ValuedItem(2) = ValuedItem(1)ValuedItem(1) = iValue = Item(GetPlayerInvItemNum(index, i)).priceEnd IfEnd IfEnd IfNext i'Drop inventory itemsFor i = 1 To MAX_INVIf i <> ValuedItem(1) And i <> ValuedItem(2) And i <> ValuedItem(3) ThenPlayerMapDropItem index, i, GetPlayerInvItemValue(index, i)End IfNext'Send all equiped items to the inventory to be dumped.For i = 1 To Equipment.Equipment_Count - 1If GetPlayerEquipment(index, i) > 0 ThenPlayerMapDropItem index, GetPlayerEquipment(index, i), 0End If'Send WeaponGiveInvItem index, GetPlayerEquipment(index, Weapon), 0SetPlayerEquipment index, 0, Weapon'Send ArmorGiveInvItem index, GetPlayerEquipment(index, Armor), 0SetPlayerEquipment index, 0, Armor'Send ShieldGiveInvItem index, GetPlayerEquipment(index, Shield), 0SetPlayerEquipment index, 0, Shield'Send HelmetGiveInvItem index, GetPlayerEquipment(index, Helmet), 0SetPlayerEquipment index, 0, HelmetNext'Drop *equipped* inventory itemsFor i = 1 To MAX_INVIf Not i = ValuedItem(1) And i <> ValuedItem(2) And i <> ValuedItem(3) Then PlayerMapDropItem index, i, 0Next```That's the end:Thanks to Carim for helping me get a better understanding of how to get the items to be looped through correctly etc. Thanks to Thomas for a base. Link to comment Share on other sites More sharing options...
egemert35 Posted April 18, 2013 Share Posted April 18, 2013 I don't understand. [>! ![](http://mmohuts.com/wp-content/gallery/neo-online-full/neo-online-loot-warrior.jpg?ec9f9b)](http://mmohuts.com/wp-content/gallery/neo-online-full/neo-online-loot-warrior.jpg?ec9f9b)Like that? Link to comment Share on other sites More sharing options...
Link Posted April 18, 2013 Author Share Posted April 18, 2013 Your own items are dropped. So if you kill someone or they're killed by an npc you can easily steal their items. Link to comment Share on other sites More sharing options...
egemert35 Posted April 18, 2013 Share Posted April 18, 2013 Okay, I understood now.Good job. ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) Link to comment Share on other sites More sharing options...
shinobugmaster Posted April 18, 2013 Share Posted April 18, 2013 it's worth killing players then have their items!! XD Link to comment Share on other sites More sharing options...
Link Posted April 18, 2013 Author Share Posted April 18, 2013 > it's worth killing players then have their items!! XDExactly. Link to comment Share on other sites More sharing options...
Domino_ Posted April 19, 2013 Share Posted April 19, 2013 You could also add check if map morale is like arena or none so if arena then items are dropped and other players can get better gear from idiots who dont know how to play ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png) and in none moral map this is disabled so wont ruin happines of leveling. xD Link to comment Share on other sites More sharing options...
Stach Posted April 19, 2013 Share Posted April 19, 2013 This could be a good thing then again bad. What if you work so hard to get items and someone kills you and you lose it all? Link to comment Share on other sites More sharing options...
Domino_ Posted April 19, 2013 Share Posted April 19, 2013 Thats why u got source code, make arena and arena1, arena is for players who dont care if they loose items or dont but there must be some bonus things like killer gets +20exp for every dropped item, and arena1 where all items are safe in bag. ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png) Link to comment Share on other sites More sharing options...
Link Posted April 19, 2013 Author Share Posted April 19, 2013 > You could also add check if map morale is like arena or none so if arena then items are dropped and other players can get better gear from idiots who dont know how to play ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png) and in none moral map this is disabled so wont ruin happines of leveling. xDDomino, good suggestion. In any case how this system is used is really up to the owner of the game who is putting it in, but when I get time I'd be happy to add a check. Link to comment Share on other sites More sharing options...
boyesjs03 Posted April 19, 2013 Share Posted April 19, 2013 Great system for PvP games, well done. Link to comment Share on other sites More sharing options...
escfoe2 Posted April 22, 2013 Share Posted April 22, 2013 Thank you for sharing this with others… Your contribution is appreciated.Another idea for you, that I'm doing with my base, is to have an option in the map properties setting whether or not to drop the items on death. Link to comment Share on other sites More sharing options...
Link Posted April 22, 2013 Author Share Posted April 22, 2013 I'll update the tutorial and add that in when I can, thanks. Right now working on stuff for EVB development. Link to comment Share on other sites More sharing options...
escfoe2 Posted April 22, 2013 Share Posted April 22, 2013 > I'll update the tutorial and add that in when I can, thanks. Right now working on stuff for EVB development.Make it how you want it. I was only offering a suggestion ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now