Help with an roguelike alias - 01/04/22 06:30 PM
Hello all of you, I've been writing a kind of Rogue Like Game Script for Mirc for a long time.
Here I come across a problem of the generation of the armor.
I have already written the alias for it but I do not know exactly how to determine the corresponding values?
Questions: How would you have the values determined? Should they be randomly determined by a value of $rand(v1,v2) or otherwise?
Here is the code:
Thanks for ideas....
Here I come across a problem of the generation of the armor.
I have already written the alias for it but I do not know exactly how to determine the corresponding values?
Questions: How would you have the values determined? Should they be randomly determined by a value of $rand(v1,v2) or otherwise?
Here is the code:
Code
alias generate_armor { var %validequiplocations head.body.legs.feet.hands set %random.location $rand(1, $numtok(%validequiplocations,46)) set %location-a $gettok(%validequiplocations, %random.location, 46) var %armorname %equipmentprefix var %hp $rand(1,900) var %tp $rand(1,100) var %Def $rand(1,5000) var %int $rand(1,5000) var %spd $rand(1,5000) var %str $rand(1,5000) var %augment %augments var %location %location-a var %cost 0 var %Sellprice $rand(1,5000) var %Level $rand(1,21000) set %protection-a $rand(0,10) $+ . $+ $rand(0,9) write $lstfile(armor_ $+ %location-a $+ .lst) %armorname writeini $dbfile(Equipment.db) %equipmentprefix Name %armorname writeini $dbfile(Equipment.db) %equipmentprefix Hp %hp writeini $dbfile(Equipment.db) %equipmentprefix Tp %tp writeini $dbfile(Equipment.db) %equipmentprefix Str %str writeini $dbfile(Equipment.db) %equipmentprefix Def %def writeini $dbfile(Equipment.db) %equipmentprefix Int %int writeini $dbfile(Equipment.db) %equipmentprefix Spd %spd writeini $dbfile(Equipment.db) %equipmentprefix Augment %augments writeini $dbfile(Equipment.db) %equipmentprefix EquipLocation %location writeini $dbfile(Equipment.db) %equipmentprefix Cost 0 writeini $dbfile(Equipment.db) %equipmentprefix SellPrice %Sellprice writeini $dbfile(Equipment.db) %equipmentprefix LevelRequirement %Level writeini $dbfile(Equipment.db) %equipmentprefix Protection %protection-a }
Thanks for ideas....