02-10-2006, 04:35 AM
Author: Leighland
Difficulty: 1/5
:: SERVER SIDE ::
In modGameLogic, and find Sub AttackNpc, find:Replace with:
You'll need to change the "1" highlighted below, to whatever the item number of your gold is:
If you want, you can change it to drop gold ONLY when the regular item assigned to the NPC is dropped. Like this:
If you want to modify how much gold is dropped, change the bolded text below to whatever you wish:
Difficulty: 1/5
:: SERVER SIDE ::
In modGameLogic, and find Sub AttackNpc, find:
Code:
' Drop the goods if they get it
n = Int(Rnd * Npc(NpcNum).DropChance) + 1
If n = 1 Then
Call SpawnItem(Npc(NpcNum).DropItem, Npc(NpcNum).DropItemValue, MapNum, MapNpc(MapNum, MapNpcNum).X, MapNpc(MapNum, MapNpcNum).y)
End If
Code:
' Drop the goods if they get it
n = Int(Rnd * Npc(NpcNum).DropChance) + 1
Call SpawnItem(1, Npc(NpcNum).STR, MapNum, MapNpc(MapNum, MapNpcNum).X, MapNpc(MapNum, MapNpcNum).y)
If n = 1 Then
Call SpawnItem(Npc(NpcNum).DropItem, Npc(NpcNum).DropItemValue, MapNum, MapNpc(MapNum, MapNpcNum).X, MapNpc(MapNum, MapNpcNum).y)
End If
You'll need to change the "1" highlighted below, to whatever the item number of your gold is:
Quote:Call SpawnItem(1, Npc(NpcNum).STR, MapNum, MapNpc(MapNum, MapNpcNum).X, MapNpc(MapNum, MapNpcNum).y)There you have it. NPCs always drop gold equal to the amount of strength they have.
If you want, you can change it to drop gold ONLY when the regular item assigned to the NPC is dropped. Like this:
Code:
' Drop the goods if they get it
n = Int(Rnd * Npc(NpcNum).DropChance) + 1
If n = 1 Then
Call SpawnItem(1, Npc(NpcNum).STR, MapNum, MapNpc(MapNum, MapNpcNum).X, MapNpc(MapNum, MapNpcNum).y)
Call SpawnItem(Npc(NpcNum).DropItem, Npc(NpcNum).DropItemValue, MapNum, MapNpc(MapNum, MapNpcNum).X, MapNpc(MapNum, MapNpcNum).y)
End If
If you want to modify how much gold is dropped, change the bolded text below to whatever you wish:
Quote:' Drop the goods if they get itThat's all!
n = Int(Rnd * Npc(NpcNum).DropChance) + 1
If n = 1 Then
Call SpawnItem(1, Npc(NpcNum).STR, MapNum, MapNpc(MapNum, MapNpcNum).X, MapNpc(MapNum, MapNpcNum).y)
Call SpawnItem(Npc(NpcNum).DropItem, Npc(NpcNum).DropItemValue, MapNum, MapNpc(MapNum, MapNpcNum).X, MapNpc(MapNum, MapNpcNum).y)
End If