Jump to content

Script Help


bencebence

Recommended Posts

Hmm, I'd like more chance for coal. So I have to change:

elseif (chance > 10)

player.additem Coal 1

message "You found some coal."

to

elseif (chance < 10)

player.additem Coal 1

message "You found some coal."

?

 

 

And one more thing: How can I set a reference to it? Like I can use it near a reference.

Link to comment
Share on other sites

Scriptname RaivenMineScript

short bluntskill
short ready
short chance
short chanceIron
short chanceSilver
short chanceGold
short chanceGlass
short chanceEbony
short playhitsound

Begin GameMode
       if (GetCrossHairRef == GetSelf) && (OnControlDown 4)
               if (Player.GetEquipped MiningPick)
               set ready to 1
               else
               Message "You must equip a Mining Pick to mine the rock."
               endif
       endif
       if (ready)
               set ready to 0
               set bluntskill to player.getactorvalue blunt
               set chance to getrandompercent
               set chanceIron to 2
               set chanceSilver to 3
               set chanceGold to 4
               set chanceGlass to 5
               set chanceEbony to 6 
               if (chance = 98)
		player.additem gem6diamondflawless 1
		message "You found a flawless diamond."
	elseif (chance == 97)
		player.additem gem6diamond 1
		message "You found a diamond."
	elseif (chance == 96)
		player.additem gem6diamondflawed 1
		message "You found a flawed diamond."
	elseif (chance == 95)
		player.additem gem5emeraldflawless 1
		message "You found a flawless emerald."
	elseif (chance == 94)
		player.additem gem5emerald 1
		message "You found am emerald."
	elseif (chance == 93)
		player.additem gem5emeraldflawed 1
		message "You found a flawed emerald."
	elseif (chance == 92)
		player.additem gem4sapphireflawless 1
		message "You found a flawless sapphire."
	elseif (chance == 91)
		player.additem gem4sapphire 1
		message "You found a sapphire."
	elseif (chance == 90)
		player.additem gem4sapphireflawed 1
		message "You found a flawed sapphire."
	elseif (chance == 89)
		player.additem gem3rubyflawless 1
		message "You found a flawless ruby."
	elseif (chance == 88)
		player.additem gem3ruby 1
		message "You found a ruby."
	elseif (chance == 87)
		player.additem gem3rubyflawed 1
		message "You found a flawed ruby."
	elseif (chance == 86)
		player.additem gem2topazflawless 1
		message "You found a flawless topaz."
	elseif (chance == 85)
		player.additem gem2topaz 1
		message "You found a topaz."
	elseif (chance == 84)
		player.additem gem2topazflawed 1
		message "You found a flawed topaz."
	elseif (chance < 10)
		player.additem Coal 1
		message "You found some coal."
	else                            ;or it could be an endif
		if (bluntskill > chance*chanceEbony)
			player.additem EbonOre 1
		elseif (bluntskill > chance*chanceIron)
			player.additem IroneOre 1
		elseif (bluntskill > chance*chanceSilver)
			player.additem Gem0SilverNugget 1
		elseif (bluntskill > chance*chanceGold)
                               player.additem Gem0GoldNugget 1
		elseif (bluntskill > chance*chanceGlass)
			player.additem glassore 1
		elseif (chance <= 10)
			message "You found nothing."
			set playhitsound to 1
		endif
	endif                           ;if you chose endif, then delete this line
	if (playhitsound == 1)
		playsound wpnhitblunt
		set playhitsound to 0
	else
		playsound wpnblockblunt
	endif
endif
       
End

Link to comment
Share on other sites

My apologies - fg109 already changed the coal probability - I misread his code. There's currently a much higher chance of coal.

 

Your line above would give a 10% chance of finding coal, which is probably about right.

 

As an exercise, try the code with numbers 1 to 100, and see what happens. Also check the percentage generator DOES give 1-100 as output, and not 0-99 as some do.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...