@Ballie: > There were two things that bugged me about NPC item drops in Eclipse Origins. The first was the lack of multiple drops. That had been done in past Eclipse releases and seemed almost necessary to add in. The second has been present for as long as I can remember. I hate the "1 in X" drop chance, particularly because of its inaccuracy. It quickly jumps from 100% chance to 50% chance to 33.3% chance, with no option of between-values. I decided to rectify these two issues I had with a little bit of editing. > > _This will require deleting all your NPCs unless you code a converter_ > > **Client-Side** > In modTypes, change the NpcRec to this: > > ``` > Private Type NpcRec > Name As String * NAME_LENGTH > AttackSay As String * 100 > Sprite As Integer > SpawnSecs As Long > Behaviour As Byte > Range As Byte > DropChance(1 To MAX_NPC_DROPS) As Double > DropItem(1 To MAX_NPC_DROPS) As Byte > DropItemValue(1 To MAX_NPC_DROPS) As Integer > Stat(1 To Stats.stat_count - 1) As Byte > faction As Byte > HP As Long > EXP As Long > Animation As Long > End Type > ``` > Make sure to add this to modConstants as well: > ``` > Public Const MAX_NPC_DROPS As Byte = 10 > ``` > > Next, you'll need to download the attached form files and replace your old ones. If you've changed anything, you can just copy the new controls and code from that file. > > **Server-side** > > On the server-side, there's a few more changes. Firstly, do the same steps as above for modTypes and modConstants. Next, we change the logic statements. Find this line in modGameLogic: > > ``` > ' Drop the goods if they get it > ``` > Make the code underneath that look like so: > > ``` > For n = 1 To MAX_NPC_DROPS > If Npc(vNpcNum).DropItem(n) = 0 Then Exit For > If Rnd Call SpawnItem(Npc(vNpcNum).DropItem(n), Npc(vNpcNum).DropItemValue(n), MapNum, MapNpc(MapNum).Npc(Victim).x, MapNpc(MapNum).Npc(Victim).y) > End If > Next > ``` > You'll also find the same line in modPlayer: > > ``` > ' Drop the goods if they get it > ```i can not find that bit plz help :mad: > Replace that code bit with this: > > ``` > For n = 1 To MAX_NPC_DROPS > If Npc(NpcNum).DropItem(n) = 0 Then Exit For > If Rnd Call SpawnItem(Npc(NpcNum).DropItem(n), Npc(NpcNum).DropItemValue(n), MapNum, MapNpc(MapNum).Npc(MapNpcNum).x, MapNpc(MapNum).Npc(MapNpcNum).y) > End If > Next > ``` > > And that's all! This adds a couple new features to the NPC editor to comply with the changes. > > * The "Chance" box now accepts only a decimal value from 0 to 1\. You can enter fractional values as well, now. For instance, you can type "5/12" for a 5 of 12 chance, or "1/10" for a 1 of 10 chance. The number will auto-convert to decimal. Additionally, you can now use percentages. Entering "25%" for example will automatically convert to ".25". > * There is now a scrollbar that determines which item drop to edit. The default maximum, as shown in the code above, is 10, but can be altered as you see fit. Marking any item number as 0 will cause the loop to exit when the NPC drop logic fires, so you cannot leave drops 1 and 2 blank and start with item drop 3, for example. > > Here's a little screenshot for those interested: > > ![](http://beaubuckley.info/derrick/DropChanges.png)