SphereCommunity
[skill ball] - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Submissions (/Forum-Script-Submissions)
+--- Thread: [skill ball] (/Thread-skill-ball)



[skill ball] - amonvangrell - 05-12-2014 12:51 PM

Just made this to my shard, was really annoying, so I've decided to share it in order to prevent another one, to go to the same stress that i went...

I didn't look to see if there was another scp with the same function...

skill ball download


RE: [skill ball] - Mordaunt - 05-13-2014 04:31 AM

Why so long?


Code:
[DIALOG d_Skill_ball BUTTON]
on=0
RETURN 1
//
ON=1 58
src.<serv.skill.<argn1>.key> = 100.0

Also what is TARG?
Under DClick the ball is default, and really should be stored in a local or something to prevent it getting messed up somwhere along the way.


RE: [skill ball] - amonvangrell - 05-13-2014 07:18 AM

omg that's why I'll be forever a nb and you a master.... lol
thanks!

Script updated!
Thanks to Mordaunt!


RE: [skill ball] - Mordaunt - 05-13-2014 05:20 PM

I neglected to mention that you can also do the same with the skill listing on your gump if you wish, just use a FOR loop to loop around the skills making sure your button is using the same local counter so that the skill matches the button.


RE: [skill ball] - amonvangrell - 05-14-2014 06:01 AM

hmmm let me try....


RE: [skill ball] - Shidhun - 05-15-2014 01:47 AM

Code:
[itemdef i_skill_ball]
id=023d
Name=Skill Ball
type=t_normal

ON=@CREATE
    color = 0800

ON=@DCLICK
    IF (<CONT> != <SRC.FINDLAYER.layer_pack.UID>)
        src.sysmessageua 0800,0,0,enu The <name> must be in your backpack.
        RETURN 1
    ENDIF
    TRY SRC.DIALOGCLOSE d_Skill_ball
    sdialog d_Skill_ball
RETURN 1

[dialog d_Skill_ball]
50,50
nodispose
noclose
page 0
resizepic 50 50 9200 558 475//grey
resizepic 55 55 9200 545 25//grey
button 568 495 4017 4018 1 1 0
dcroppedtext 230 58 1000 200 0800 Choose ONE skill to improve to 100.0

local.offx=56
local.offy=90
for 1 58
    gumppictiled <dlocal.offx> (<dlocal.offy>+1) 170 20 3004
    dcroppedtext (<dlocal.offx>+4) (<dlocal.offy>+2) 1000 200 0800 <serv.skill.<eval <local._for>-1>.key>
    button (<dlocal.offx>+144) <dlocal.offy> 4023 4025 1 0 <dlocal._for>
    if (<dlocal._for> == 20)
        local.offx = 240
        local.offy = 90
    elif (<dlocal._for> == 39)
        local.offx = 424
        local.offy = 90
    else
        local.offy += 21
    endif
endfor

[DIALOG d_Skill_ball BUTTON]
on=0
RETURN 1

ON=1 58
    src.<serv.skill.<eval <argn1>-1>.key> = 100.0
    src.sysmessageua 0800,0,0,enu The magic of the <name> raises your wisdom.
    remove



RE: [skill ball] - Alaric - 05-15-2014 02:21 AM

2 forcycles would be even nicer. You don't need the 10 lines long if,elif,else,endif block

Code:
for i 0 2
    for j 0 57
       dtext
       button      
    endfor
endfor

After that, the script should be shrinked to minimum. Btw. there are 2 skillpoints i think. One from me (but it sux, you can't change it easily, only inspire or use it as it is...) and some other pretty long as your first version.


RE: [skill ball] - amonvangrell - 05-15-2014 08:33 AM

Oh lord.... thanks guys....
Look what knowledge has made of this gigantic script... tine and smoother. Big Grin