## FANDOM

170 Pages

Function Main()
Player = Actor()
Zone\$ = ActorZone(Player)
X# = Parameter(3)
Y# = Parameter(4)
Z# = Parameter(5)
GLoot=0
;r\$ = Parameter(1) ; The Race of the NPC
monster\$ = Parameter(2) ; The Class of the NPC
If monster\$="Rat" Then
ARand = Rand(1,100)  ;change the 1,3 to the range of items eg: for four items change it to 1,4
If ARand>=1 And ARand<=33 Then
Item\$ = "Imperial Armor"
ElseIf ARand>=33 And ARand<=66 Then
Item\$ = "Imperial Helmet"
ElseIf ARand>=66 And ARand<=99 Then
Item\$ = "Sword"
EndIf
ARand2 = Rand(1,10) ;change that for the amount of gold given
GLoot=ARand2
ElseIf monster\$ = "Bear" then
ARand3 = Rand(1,100)  ;change the 1,3 to the range of items eg: for five items change it to 1,5
If ARand3>=1 And ARand3<=33 Then
Item\$ = "Imperial Armor"
ElseIf ARand3>=33 And ARand3<=66 Then
Item\$ = "Imperial Helmet"
ElseIf ARand3>=66 And ARand3<=99 Then
Item\$ = "Scarred Shield"
EndIf
ARand4 = Rand(1,25) ;change that for the amount of gold given
GLoot=ARand2
EndIf
SpawnItem(Item\$, 1, Zone, X, Y, Z)
If GLoot>0 Then
Output(Actor(),"You looted a " + Item\$)
Output(Actor(),"You recieved " + GLoot + "copper")
ChangeMoney(Actor(), GLoot)
Else
Output(Actor(),"You looted " + Item\$)
EndIf
Return
End Function