JohnPony Posted September 29, 2012 Author Share Posted September 29, 2012 in the server in modCombat in the PlayerAttackNpc procedure replace your npc item drop code with this:```' Check if the player is in a party! If TempPlayer(Attacker).inParty <> 0 Then Num = rand(1, Party(TempPlayer(Attacker).inParty).MemberCount) 'Drop the goods if they get it For n = 1 To MAX_NPC_DROPS If NPC(NpcNum).DropItem(n) = 0 Then Exit For If Rnd <= NPC(NpcNum).DropChance(n) Then Call GiveInvItem(Party(TempPlayer(Attacker).inParty).Member(Num), NPC(NpcNum).DropItem(n), NPC(NpcNum).DropItemValue(n), True) Call PartyMsg(TempPlayer(Attacker).inParty, GetPlayerName(Party(TempPlayer(Attacker).inParty).Member(Num)) & " Won " & Trim$(Item(NPC(NpcNum).DropItem(n)).Name) & "!", Red) End If Next End If If TempPlayer(Attacker).inParty = 0 Then 'Drop the goods if they get it For n = 1 To MAX_NPC_DROPS If NPC(NpcNum).DropItem(n) = 0 Then Exit For If Rnd <= NPC(NpcNum).DropChance(n) Then Call SpawnItem(NPC(NpcNum).DropItem(n), NPC(NpcNum).DropItemValue(n), mapnum, MapNpc(mapnum).NPC(MapNpcNum).x, MapNpc(mapnum).NPC(MapNpcNum).y) End If Next End If```You may need to change the code to match your server's drop procedure, but you should get the idea ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png) Link to comment Share on other sites More sharing options...
killzoz Posted October 7, 2012 Share Posted October 7, 2012 > in the server in modCombat in the PlayerAttackNpc procedure replace your npc item drop code with this:> > ```> > ' Check if the player is in a party!> > > > If TempPlayer(Attacker).inParty <> 0 Then> > > > Num = rand(1, Party(TempPlayer(Attacker).inParty).MemberCount)> > > > 'Drop the goods if they get it> > For n = 1 To MAX_NPC_DROPS> > If NPC(NpcNum).DropItem(n) = 0 Then Exit For> > If Rnd <= NPC(NpcNum).DropChance(n) Then> > Call GiveInvItem(Party(TempPlayer(Attacker).inParty).Member(Num), NPC(NpcNum).DropItem(n), NPC(NpcNum).DropItemValue(n), True)> > Call PartyMsg(TempPlayer(Attacker).inParty, GetPlayerName(Party(TempPlayer(Attacker).inParty).Member(Num)) & " Won " & Trim$(Item(NPC(NpcNum).DropItem(n)).Name) & "!", Red)> > End If> > Next> > > > End If> > > > If TempPlayer(Attacker).inParty = 0 Then> > > > 'Drop the goods if they get it> > For n = 1 To MAX_NPC_DROPS> > If NPC(NpcNum).DropItem(n) = 0 Then Exit For> > If Rnd <= NPC(NpcNum).DropChance(n) Then> > Call SpawnItem(NPC(NpcNum).DropItem(n), NPC(NpcNum).DropItemValue(n), mapnum, MapNpc(mapnum).NPC(MapNpcNum).x, MapNpc(mapnum).NPC(MapNpcNum).y)> > End If> > Next> > > > End If> > ```> > You may need to change the code to match your server's drop procedure, but you should get the idea ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png)Nice, big code i ever seen. Link to comment Share on other sites More sharing options...
Matt Posted October 7, 2012 Share Posted October 7, 2012 From what i understand, it gives everybody in the party the same loot correct? Link to comment Share on other sites More sharing options...
Ertzel Posted October 7, 2012 Share Posted October 7, 2012 If you are in a party, it picks a random member from your party using the line```Num = rand(1, Party(TempPlayer(Attacker).inParty).MemberCount)```Then when it drops the item it only gives it to that random party member it selected earlier and drops the item directly into their backpack.So only one member gets the loot, not everyone. Link to comment Share on other sites More sharing options...
Matt Posted October 7, 2012 Share Posted October 7, 2012 Ahh ok thank you! I missed that line. 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