Alaric
Journeyman
Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7
|
Skillbonus
- using tag.skillbonus you set points
- there are 4 groups of skills you can upgrade (from the easiest to learn = group1 to the most difficult group4
- ignoring Stealing
- if you are using items which decrease skills, unequip them
- gump is not dynamic!!! If you change groups, you must change gump (you can create 4 pages, or even more, so it will be easy to change, but i like it this way... on one page)
This is made as a reward for quests or you can script your own item, which can be randomly found in the world (in npcs...)
Code:
VERSION=0.56b
//In case you don't have getarg, getargcount
[function GetArg]
//argv[0] pozice argumentu ktery chceme zjistit, do ostatniho VSECHNY argumenty
return <argv[<argv[0]>]>
[function GetArgCount]
//cele .. rozkouskuje a odesle pocet jednotlivych arg zpet
if <argv> > 0
if <argv[0]>==0
return <eval 0>
else
return <argv>
endif
endif
[defname SkillBonusGroup]
SkillBonus_group1 1,2,3,4,6,14,16,19,20,28,29,36,38
SkillBonus_group2 5,9,15,18,21,22,26,27,30,31,32,40,41,42,43,44,45,46,47
SkillBonus_group3 7,0,8,10,11,12,17,24,34,37,39
SkillBonus_group4 13,23,25,35
//34(Stealing)???
[function test002]
if <isempty <src.tag0.skillbonus>>
src.tag.skillbonus = 0
endif
sdialog d_SkillBonus
[dialog d_SkillBonus]
250,100
PAGE 0
resizepic 35 20 5120 600 600 //pole (the field)
gumppic 35 20 202 //kraje (edges)
gumppic 35 305 202
gumppic 620 20 203
gumppic 620 305 203
for 20
gumppic 620 <EVAL (<LOCAL._FOR>*30)-9> 10460 //ctverecky - svisle (squares - vertically)
endfor
for 20
gumppic 49 <EVAL (<LOCAL._FOR>*30)-9> 10460
endfor
gumppic 620 220 028ab //drak + vocas (dragon + tail)
gumppic 620 44 028aa
gumppic 79 20 023fc
for 107
gumppic <eval (<LOCAL._FOR>*5)+77> 20 023fc //cary - vodorovne (lines - horizontally)
endfor
for 108
gumppic <eval (<LOCAL._FOR>*5)+77> 20 023fc
endfor
for 108
gumppic <eval (<LOCAL._FOR>*5)+74> 55 023fc
endfor
for 108
gumppic <eval (<LOCAL._FOR>*5)+74> 200 023fc
endfor
for 108
gumppic <eval (<LOCAL._FOR>*5)+74> 585 023fc
endfor
dhtmlgump 175 35 300 50 0 0 <DEF.BFONT_WHITE>Systém skill bodu // (The skillbonus system)
local.x = 20
local.pocatekseznamX 95
dhtmlgump 97 213 300 50 0 0 <DEF.BFONT_WHITE>Bonus za 1 bod //Bonus for 1 point
for <GetArgCount <def.SkillBonus_group1>>
button <dlocal.pocatekseznamX> <eval (217+(<local._for>*<local.x>))> 015e1 015e3 1 0 <eval <GetArg <dlocal._for>,<def.SkillBonus_group1>> +1>
dtext <eval <dlocal.pocatekseznamX> +19> <eval (215+(<local._for>*<local.x>))> 88 <serv.skill.<GetArg <dlocal._for>,<def.SkillBonus_group1>>.name>
dtext <eval <dlocal.pocatekseznamX> +114> <eval (215+(<local._for>*<local.x>))> 88 <uid.<uid>.<serv.skill.<GetArg <dlocal._for>,<def.SkillBonus_group1>>.name>>%
endfor
dhtmlgump 97 513 300 50 0 0 <DEF.BFONT_WHITE>Bonus za 2 body
for 1 2
button <dlocal.pocatekseznamX> <eval (518+(<local._for>*<local.x>))> 015e1 015e3 1 0 <eval <GetArg <dlocal._for>,<def.SkillBonus_group2>> +1>
dtext <eval <dlocal.pocatekseznamX> +19> <eval (516+(<local._for>*<local.x>))> 88 <serv.skill.<GetArg <dlocal._for>,<def.SkillBonus_group2>>.name>
dtext <eval <dlocal.pocatekseznamX> +114> <eval (516+(<local._for>*<local.x>))> 88 <uid.<uid>.<serv.skill.<GetArg <dlocal._for>,<def.SkillBonus_group2>>.name>>%
endfor
local.x = 21
local.pocatekseznamX 275
for 3 <GetArgCount <def.SkillBonus_group2>>
button <dlocal.pocatekseznamX> <eval (222+(<eval <local._for> -3>*<local.x>))> 015e1 015e3 1 0 <eval <GetArg <dlocal._for>,<def.SkillBonus_group2>> +1>
dtext <eval <dlocal.pocatekseznamX> +19> <eval (220+(<eval <local._for> -3>*<local.x>))> 88 <serv.skill.<GetArg <dlocal._for>,<def.SkillBonus_group2>>.name>
dtext <eval <dlocal.pocatekseznamX> +114> <eval (220+(<eval <local._for> -3>*<local.x>))> 88 <uid.<uid>.<serv.skill.<GetArg <dlocal._for>,<def.SkillBonus_group2>>.name>>%
endfor
dhtmlgump 457 213 300 50 0 0 <DEF.BFONT_WHITE>Bonus za 3 body
local.x = 20
local.pocatekseznamX 455
for <GetArgCount <def.SkillBonus_group3>>
button <dlocal.pocatekseznamX> <eval (217+(<local._for>*<local.x>))> 015e1 015e3 1 0 <eval <GetArg <dlocal._for>,<def.SkillBonus_group3>> +1>
dtext <eval <dlocal.pocatekseznamX> +19> <eval (215+(<local._for>*<local.x>))> 88 <serv.skill.<GetArg <dlocal._for>,<def.SkillBonus_group3>>.name>
dtext <eval <dlocal.pocatekseznamX> +114> <eval (215+(<local._for>*<local.x>))> 88 <uid.<uid>.<serv.skill.<GetArg <dlocal._for>,<def.SkillBonus_group3>>.name>>%
endfor
dhtmlgump 457 473 300 50 0 0 <DEF.BFONT_WHITE>Bonus za 4 body
for <GetArgCount <def.SkillBonus_group4>>
button <dlocal.pocatekseznamX> <eval (478+(<local._for>*<local.x>))> 015e1 015e3 1 0 <eval <GetArg <dlocal._for>,<def.SkillBonus_group4>> +1>
dtext <eval <dlocal.pocatekseznamX> +19> <eval (476+(<local._for>*<local.x>))> 88 <serv.skill.<GetArg <dlocal._for>,<def.SkillBonus_group4>>.name>
dtext <eval <dlocal.pocatekseznamX> +114> <eval (476+(<local._for>*<local.x>))> 88 <uid.<uid>.<serv.skill.<GetArg <dlocal._for>,<def.SkillBonus_group4>>.name>>%
endfor
dhtmlgump 460 597 300 50 0 0 <DEF.BFONT_WHITE>Aktualni pocet bodu: <src.dtag0.skillbonus> //Points you have now.
[dialog d_SkillBonus button]
on=1 49
f_SkillBonus_gain <argn> //argn o jedno vetsi, jak index skillu
src.sdialog d_SkillBonus
[function f_SkillBonus_gain]
local.skill = <eval <argn> - 1>
if (<src.<eval <local.skill>>> >= 1000)
src.sysmessage @color_o_bloodrock Uz si mistr v teto dovednosti! //You've already been GM in this skill.
else
local.i = 1
while (<dlocal.i> < 5)
for <GetArgCount <def.SkillBonus_group<dlocal.i>>>
if (<GetArg <dlocal._for>,<def.SkillBonus_group<dlocal.i>>> == <local.skill>)
local.group = <dlocal.i>
endif
endfor
local.i += 1
endwhile
if (<dlocal.group> > <src.dtag0.skillbonus>)
src.sysmessage @color_o_bloodrock Nemas dostatek bodu!! //Don't have enough points
else
src.<serv.skill.<dlocal.skill>.name>=<eval <uid.<uid>.<serv.skill.<dlocal.skill>.name>> + 0.1>
src.tag.skillbonus -= <dlocal.group>
endif
endif
(This post was last modified: 05-17-2013 11:17 PM by Alaric.)
|
|