The forums will be going offline for an extended maintenance period at 1400hrs GMT on 19th June 2025. The number of hours for this downtime is intentionally not advertised due to the nature of these upgrades.
×
- 0
About 'array' and 'randomize'.
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
Psyche
Hi community.
I'm newbie and want to learn about array things. What the difference between . @ and $ or anything that scripter's usually used. I saw some used bracket [ ] too.
For my curious, I made a test script but I think I fail to code / the result is not as expected.
Heres the script. The purpose is give 4 equipment (Armor, Shield, Garments, and Shoes) to player with random refine +0 ~ +7 and random enchanted stone/orb.
function script Test { setarray .Ref[0],0,1,2,3,4,5,6,7; setarray .Orb[0],4700,4701,4702; setarray .Armors[0],2301,2303,2305; setarray .Shields[0],2101,2103; setarray .Garments[0],2512,2501,2503,2505; setarray .Shoes[0],2416,2401,2403,2405,2411; set .Rand1, rand( getarraysize(.Ref) ); set .Rand2, rand( getarraysize(.Orb) ); set .RandA, rand( getarraysize(.Armors) ); set .RandB, rand( getarraysize(.Shields) ); set .RandC, rand( getarraysize(.Garments) ); set .RandD, rand( getarraysize(.Shoes) ); getitembound2 .Armors[.RandA], 1, 1, .Ref[.Rand1], 0, 0, 0, 0, .Orb[.Rand2], 1; getitembound2 .Shields[.RandB], 1, 1, .Ref[.Rand1], 0, 0, 0, 0, .Orb[.Rand2], 1; getitembound2 .Garments[.RandC], 1, 1, .Ref[.Rand1], 0, 0, 0, 0, .Orb[.Rand2], 1; getitembound2 .Shoes[.RandD], 1, 1, .Ref[.Rand1], 0, 0, 0, 0, .Orb[.Rand2], 1; end; }
But that script give random armors, shield, garments, and shoes only. The Refine and Orb don't randomize. So the example result was :
First open : +1 Cotton Shirt [STR +2] | +1 Muffler [STR +2] | +1 Guard [STR+2] | +1 Shoes [STR+2]
Second open : +3 Cotton Shirt [INT +1] | +3 Manteau [INT +1] | +3 Buckler [INT+1] | +3 Shoes [INT +1]
Get same refine and enchant. But the equipments are randomized. The expected result should be randomize everything. Please help me.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.