SphereCommunity
Random Armour Generator - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Random Armour Generator (/Thread-Random-Armour-Generator)

Pages: 1 2


Random Armour Generator - htid4life - 09-23-2012 11:06 PM

Hey on the old sphere forums there was a script i think it was buy soulless
that it completely added random armour on rare loot system or some thing for example


[ITEMDEF i_arms_rarearmour]
id=i_arms
name=Arms

on=@create
dorand
name=Arms of the gods
name=Arms of the devil
name=arms of copper
end

dorand
id=i_platemail_arms
id=i_ringmail_arms
end

dorand
modar=30
modar=40
end

dorand
color=03
color=05
color=06
end

and so on i know this is totaly wrong i used it as example any one got the script im looking for?


RE: Random Armour Generator - Extreme - 09-24-2012 12:19 AM

PHP Code:
DoRand x
 1
 2
 
..
 
x
EndDo 
Example:
PHP Code:
dorand 3
name
=Arms of the gods
name
=Arms of the devil
name
=arms of copper
enddo 



RE: Random Armour Generator - Skul - 09-24-2012 12:42 AM

set a local, and read it to determine which type of armor it will be
Code:
local.rnd=<eval {1 1 2 5 3 10}>
if (<dlocal.rnd>==1)
  name=arms of god
  dispid=i_platemail_arms
  modar=30
  color=03
elseif (<dlocal.rnd>==2)
  name=arms of devil
  dispid=i_ringmail_arms
  modar=40
  color=05
elseif (<dlocal.rnd>==3)
  name=arms of copper
  dispid=i_ringmail_arms
  modar=40
  color=06
endif
update



RE: Random Armour Generator - htid4life - 09-26-2012 09:13 PM

Hey Thanks for the replys but i got abit of a problem

When i create the armor it gives me random luck every time i drag and drop it meaning luck changes all time when i equip it

Code:
[ITEMDEF i_rare_legs]
TYPE=T_ARMOR
WEIGHT=7
ARMOR=5
REQSTR=50
CATEGORY=Anthony
SUBSECTION=Rare
DESCRIPTION=Legs



ON=@Create
MOREY=100.0
ATTR=attr_magic
HITPOINTS=300
EVENTS=t_modar
EVENTS=t_luck_item

local.rnd=<eval {1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1}>
if (<dlocal.rnd>==1)
  name=Devil Legs
  id=i_platemail_leggings
  tag.devilarmor=1
  type=t_armor
  modar=12
  color=0a93
  tag.luck=40
elseif (<dlocal.rnd>==2)
  name=Angel Legs
  type=t_armor
  tag.angelarmor=1
  id=i_platemail_leggings
  modar=12
  color=080e
tag.luck={1 100}
elseif (<dlocal.rnd>==3)
  name=Dragon legs
  type=t_armor
  tag.dragonarmor=1
  id=i_platemail_leggings
  modar=11
  color=0b99
tag.luck={1 100}
elseif (<dlocal.rnd>==4)
  name=Ettin legs
  type=t_armor
  tag.ettinarmor=1
  id=i_platemail_leggings
  modar=4
  color=0a94
tag.luck={1 100}
elseif (<dlocal.rnd>==5)
  name=Legs Of The Beast
  type=t_armor
  id=i_platemail_leggings
  modar=1
  color=047e
tag.luck={1 100}
elseif (<dlocal.rnd>==6)
  name=Dark legs
  type=t_armor
  id=i_platemail_leggings
  modar=3
  color=0a6f
tag.luck={1 100}
elseif (<dlocal.rnd>==7)
  name=Myter legs
  type=t_armor
  id=i_platemail_leggings
  modar=1
  color=0a75
tag.luck={1 100}
elseif (<dlocal.rnd>==8)
  name=Mystic legs
  type=t_armor
  id=i_platemail_leggings
  modar=2
  color=0a35
tag.luck={1 100}
elseif (<dlocal.rnd>==9)
  name=Xperian legs
  type=t_armor
  id=i_platemail_leggings
  modar=3
  color=0a23
tag.luck={1 100}
elseif (<dlocal.rnd>==10)
  name=Dread legs
  type=t_armor
  id=i_platemail_leggings
  modar=4
  color=0818
tag.luck={1 100}
elseif (<dlocal.rnd>==11)
  name=Balron legs
  tag.balronarmor=1
  type=t_armor
  id=i_platemail_leggings
  modar=5
  color=0817
tag.luck={1 100}
elseif (<dlocal.rnd>==12)
  name=Carbon legs
  type=t_armor
  id=i_platemail_leggings
  modar=6
  color=07
tag.luck={1 100}
elseif (<dlocal.rnd>==13)
  name=Ruin legs
  type=t_armor
  id=i_platemail_leggings
  modar=8
  color=054b
tag.luck={1 100}
elseif (<dlocal.rnd>==14)
  name=Power legs
  type=t_armor
  tag.powerarmor=1
  id=i_platemail_leggings
  modar=9
  color=056b
tag.luck={1 100}
elseif (<dlocal.rnd>==15)
  name=Vanq legs
  type=t_armor
  id=i_platemail_leggings
  modar=15
  tag.vanqlarmor=1
  color=0813
tag.luck={100 180}
endif
update



RE: Random Armour Generator - Mordaunt - 09-26-2012 09:51 PM

Because you told it to....

Tag.luck {1 100} randomised it *slap*


RE: Random Armour Generator - htid4life - 09-26-2012 09:53 PM

so ur telling me every time i drag a Already created piece of armor it fires on=@create again???


RE: Random Armour Generator - RanXerox - 09-26-2012 11:54 PM

Perhaps you are setting the value of the TAG to literally "{1 100}" (since a TAG is a string by nature)... try TAG.LUCK=<R1,100> or maybe <EVAL <R1,100>>


RE: Random Armour Generator - htid4life - 09-27-2012 04:44 AM

Thanks guys im usng

tag.luck=<EVAL <R1,100>> and its working like a charm thanks again


RE: Random Armour Generator - admin phoenix - 10-02-2012 10:28 PM

should it not be
<eval {R1,100}>

????


RE: Random Armour Generator - Extreme - 10-02-2012 11:57 PM

(10-02-2012 10:28 PM)admin phoenix Wrote:  should it not be
<eval {R1,100}>

????
No no, <R1,100> or <EVAL <R1,100>> or <EVAL RAND(1,100)>