Chojiros Blog

June 05, 2006

Mining Script!!

Post this under the SubCommand(Index). This is for mining ore, using 4 different picks, which have different chances as you go down, you can copy it and edit the numbers in...
DropChance = Int(Rnd * 20)
If DropChance > 15 Then

This [i]does[/i] work!


'MINING

Dim DropChance
If Mid(GetPlayerStringCommand(Index), 1, 4) = "/dig" Then
If GetPlayerMap(Index) = [Map] Then
Select Case GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))

Case [LowestPickNum]:
DropChance = Int(Rnd * 100)
If DropChance > 70 Then
Call GiveItem(Index, [OreItemNum], 1)
Call PlayerMsg(Index, "You have gained 400 experience!", 6)
Call SetPlayerEXP(Index, GetPlayerEXP(Index) + 400)
Call CheckPlayerLevelUp(Index)
Call PlayerMsg(Index, "Excavation was successful. You gained one ____", 6)
Else
Call PlayerMsg(Index, "Excavation has failed.", 12)
End If
Call SetPlayerInvItemDur(Index, GetPlayerWeaponSlot(Index), GetPlayerInvItemDur(Index, GetPlayerWeaponSlot(Index)) - 1)
If GetPlayerInvItemDur(Index, GetPlayerWeaponSlot(Index)) <= 0 Then
Call PlayerMsg(Index, "Your pickaxe has broken!!", 14)
Call TakeItem(Index, GetPlayerWeaponSlot(Index), 1)
Call SetPlayerWeaponSlot(Index, 0)
End If

Case [LowPickNum]:
DropChance = Int(Rnd * 100)
If DropChance > 58 Then
Call GiveItem(Index, [OreItemNum], 1)
Call PlayerMsg(Index, "You have gained 700 experience!", 6)
Call SetPlayerEXP(Index, GetPlayerEXP(Index) + 700)
Call CheckPlayerLevelUp(Index)
Call PlayerMsg(Index, "Excavation was successful. You gained one ____", 6)
Else
Call PlayerMsg(Index, "Excavation has failed.", 12)
End If
Call SetPlayerInvItemDur(Index, GetPlayerWeaponSlot(Index), GetPlayerInvItemDur(Index, GetPlayerWeaponSlot(Index)) - 1)
If GetPlayerInvItemDur(Index, GetPlayerWeaponSlot(Index)) <= 0 Then
Call PlayerMsg(Index, "Your pickaxe has broken!!", 14)
Call TakeItem(Index, GetPlayerWeaponSlot(Index), 1)
Call SetPlayerWeaponSlot(Index, 0)
End If

Case [HighPickNum]:
DropChance = Int(Rnd * 100)
If DropChance > 46 Then
Call GiveItem(Index, [OreItemNum], 1)
Call PlayerMsg(Index, "You have gained 1200 experience!", 6)
Call SetPlayerEXP(Index, GetPlayerEXP(Index) + 1200)
Call CheckPlayerLevelUp(Index)
Call PlayerMsg(Index, "Excavation was successful. You gained one ____", 6)
Else
Call PlayerMsg(Index, "Excavation has failed.", 12)
End If
Call SetPlayerInvItemDur(Index, GetPlayerWeaponSlot(Index), GetPlayerInvItemDur(Index, GetPlayerWeaponSlot(Index)) - 1)
If GetPlayerInvItemDur(Index, GetPlayerWeaponSlot(Index)) <= 0 Then
Call PlayerMsg(Index, "Your pickaxe has broken!!", 14)
Call TakeItem(Index, GetPlayerWeaponSlot(Index), 1)
Call SetPlayerWeaponSlot(Index, 0)
End If

Case [HighestPickNum]:
DropChance = Int(Rnd * 100)
If DropChance > 34 Then
Call GiveItem(Index, [OreItemNum], 1)
Call PlayerMsg(Index, "You have gained 2000 experience!", 6)
Call SetPlayerEXP(Index, GetPlayerEXP(Index) + 2000)
Call CheckPlayerLevelUp(Index)
Call PlayerMsg(Index, "Excavation was successful. You gained one ____", 6)
Else
Call PlayerMsg(Index, "Excavation has failed.", 12)
End If
Call SetPlayerInvItemDur(Index, GetPlayerWeaponSlot(Index), GetPlayerInvItemDur(Index, GetPlayerWeaponSlot(Index)) - 1)
If GetPlayerInvItemDur(Index, GetPlayerWeaponSlot(Index)) <= 0 Then
Call PlayerMsg(Index, "Your pickaxe has broken!!", 14)
Call TakeItem(Index, GetPlayerWeaponSlot(Index), 1)
Call SetPlayerWeaponSlot(Index, 0)
End If

End Select
End If
End If

0 Comments:

Post a Comment

<< Home