Jump to content

Mining scripting one more time


bencebence

Recommended Posts

Hey everyone!

Alright, I start to get angry on this mining script.

I 'tought' that making each ore to have own vein would be easier. The scripting was that. It looked pretty simple.

But when I tested in-game... :wallbash: Don't ask it...

First there were no problems. But when I entered the mine... One of the scripts started runing without I'm activating anything. I didn't even wear the pick! The mining sound was going and going, and it didn't stop, and also showed the message, that it didn't found anything. Then I activated a daedrite vein. And all the gates of Oblivion opened... My bag fulled with daedrite ores in about 1 minute, and also there were two mining sounds.

Anyways here are all the scripts:

Scriptname RaivenAyliiteOre

short bluntskill
short ready
short chance
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

	elseif (chance > 30 && bluntskill <= 50)
		player.additem AyliiteOre 1
	elseif (chance >= 14 && chance <= 30 && bluntskill <= 50)
		player.additem JunkOre 1
	elseif (chance < 14 && bluntskill <= 50)
		message "You found nothing."
		set playhitsound to 1
	elseif (bluntskill > 50)
		message "You don't have high enough blunt skill to mine this vein."
	endif
if (playhitsound == 1)
	playsound wpnhitblunt
	set playhitsound to 0
else
	playsound wpnblockblunt
endif
End

Ayliite Ore

Scriptname RaivenCoalOre

short bluntskill
short ready
short chance
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

	elseif (chance > 30 && bluntskill <= 18)
		player.additem Coal 1
	elseif (chance >= 14 && chance <= 30 && bluntskill <= 18)
		player.additem JunkOre 1
	elseif (chance < 14 && bluntskill <= 18)
		message "You found nothing."
		set playhitsound to 1
	elseif (bluntskill > 18)
		message "You don't have high enough blunt skill to mine this vein."
	endif
if (playhitsound == 1)
	playsound wpnhitblunt
	set playhitsound to 0
else
	playsound wpnblockblunt
endif

Coal Ore

Scriptname RaivenCopperOre

short bluntskill
short ready
short chance
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

	elseif (chance > 30 && bluntskill <= 1)
		player.additem CopperOre 1
	elseif  (chance >= 14 && chance <= 30 && bluntskill <= 1)
		player.additem JunkOre 1
	elseif (chance < 14 && bluntskill <= 1)
		message "You found nothing."
		set playhitsound to 1
	elseif (bluntskill > 1)
		message "You don't have high enough blunt skill to mine this vein."
	endif
if (playhitsound == 1)
	playsound wpnhitblunt
	set playhitsound to 0
else
	playsound wpnblockblunt
endif
End

Copper Ore

Scriptname RaivenCrystaliteOre

short bluntskill
short ready
short chance
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

	elseif (chance > 30 && bluntskill <= 60)
		player.additem CrystaliteOre 1
	elseif (chance >= 14 && chance <= 30 && bluntskill <= 60)
		player.additem JunkOre 1
	elseif (chance < 14 && bluntskill <= 60)
		message "You found nothing."
		set playhitsound to 1
	elseif (bluntskill > 60)
		message "You don't have high enough blunt skill to mine this vein."
	endif
if (playhitsound == 1)
	playsound wpnhitblunt
	set playhitsound to 0
else
	playsound wpnblockblunt
endif
End

Crystalite Ore

Scriptname RaivenDaedriteOre

short bluntskill
short ready
short chance
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

	elseif (chance > 30 && bluntskill <= 80)
		player.additem DaedriteOre 1
	elseif (chance <= 30 && chance >= 14 && bluntskill <= 80)
		player.additem JunkOre 1
	elseif (chance < 14 && bluntskill <= 80)
		message "You found nothing."
		set playhitsound to 1
	elseif (bluntskill > 80)
		message "You don't have high enough blunt skill to mine this vein."
	endif
if (playhitsound == 1)
	playsound wpnhitblunt
	set playhitsound to 0
else
	playsound wpnblockblunt
endif
End

Daedrite Ore

Scriptname RaivenDwarfiteOre

short bluntskill
short ready
short chance
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

	elseif (chance > 30 && bluntskill <= 25)
		player.additem DwarfiteOre 1
	elseif (chance <= 30 && chance >= 14 && bluntskill <= 25)
		player.additem JunkOre 1
	elseif (chance < 14 && bluntskill <= 25)
		message "You found nothing."
		set playhitsound to 1
	elseif (bluntskill > 25)
		message "You don't have high enough blunt skill to mine this vein."
	endif
if (playhitsound == 1)
	playsound wpnhitblunt
	set playhitsound to 0
else
	playsound wpnblockblunt
endif
End

Dwarfite Ore

Scriptname RaivenEbonyOre

short bluntskill
short ready
short chance
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

	elseif (chance > 30 && bluntskill <= 70)
		player.additem EbonOre 1
	elseif (chance >= 14 && chance <= 30 && bluntskill <= 70)
		player.additem JunkOre 1
	elseif (chance < 14 && bluntskill <= 70)
		message "You found nothing."
		set playhitsound to 1
	elseif (bluntskill > 70)
		message "You don't have high enough blunt skill to mine this vein."
	endif
if (playhitsound == 1)
	playsound wpnhitblunt
	set playhitsound to 0
else
	playsound wpnblockblunt
endif
End

Ebony Ore

Scriptname RaivenIronOre

short bluntskill
short ready
short chance
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

	elseif (chance > 74 && chance <= 89 && bluntskill <= 10)
		player.additem PureIronOre 1
	elseif (chance > 49 && chance <= 74 && bluntskill <= 10)
		player.additem IroneOre 1
	elseif (chance > 14 && chance <= 49 && bluntskill <= 10)
		player.additem ImpureIronOre 1
	elseif (chance > 89 && bluntskill <= 10)
		player.additem JunkOre 1
	elseif (chance <= 14 && bluntskill <= 10)
		message "You found nothing."
		set playhitsound to 1
	elseif (bluntskill > 10)
		message "You don't have high enough blunt skill to mine this vein."
	endif
if (playhitsound == 1)
	playsound wpnhitblunt
	set playhitsound to 0
else
	playsound wpnblockblunt
endif
End

Iron Ore

Scriptname RaivenMithrilOre

short bluntskill
short ready
short chance
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

	elseif (chance > 30 && bluntskill <= 35)
		player.additem MithrilOre 1
	elseif (chance >= 14 && chance <= 30 && bluntskill <= 35)
		player.additem JunkOre 1
	elseif (chance < 14 && bluntskill <= 35)
		message "You found nothing."
		set playhitsound to 1
	elseif (bluntskill > 35)
		message "You don't have high enough blunt skill to mine this vein."
	endif
if (playhitsound == 1)
	playsound wpnhitblunt
	set playhitsound to 0
else
	playsound wpnblockblunt
endif
End

Mithril Ore

Scriptname RaivenTinOre

short bluntskill
short ready
short chance
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

	elseif (chance > 30 && bluntskill <= 5)
		player.additem TinOre 1
	elseif  (chance >= 14 && chance <= 30 && bluntskill <= 5)
		player.additem JunkOre 1
	elseif (chance < 14 && bluntskill <= 5)
		message "You found nothing."
		set playhitsound to 1
	elseif (bluntskill > 5)
		message "You don't have high enough blunt skill to mine this vein."
	endif
if (playhitsound == 1)
	playsound wpnhitblunt
	set playhitsound to 0
else
	playsound wpnblockblunt
endif
End

Tin Ore

 

Thanks in advance, (if anyone knows anything to solve this case)

 

bencebence

Link to comment
Share on other sites

Change the first "elseif (chance > 30 && bluntskill <= 5)" to "if (chance > 30 && bluntskill <= 5)" in each script. Then add another "endif" for "if (Ready)".

Try that ;)

 

Example:

	if (ready)
	set ready to 0
	set bluntskill to player.getactorvalue blunt
	set chance to getrandompercent

	if (chance > 30 && bluntskill <= 50)
		player.additem AyliiteOre 1
	elseif (chance >= 14 && chance <= 30 && bluntskill <= 50)
		player.additem JunkOre 1
	elseif (chance < 14 && bluntskill <= 50)
		message "You found nothing."
		set playhitsound to 1
	elseif (bluntskill > 50)
		message "You don't have high enough blunt skill to mine this vein."
	endif
endif

Edited by Alexx378
Link to comment
Share on other sites

  • Recently Browsing   0 members

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