The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 2 Votes - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Skillbonus
Author Message
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #1
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 Smile
- 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.)
05-17-2013 11:12 PM
Find all posts by this user Like Post Quote this message in a reply
amonvangrell
Banned

Posts: 337
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #2
RE: Skillbonus
nice, thx!
05-21-2013 01:07 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Monty
Apprentice
*

Posts: 40
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jun 2012
Reputation: 1



Post: #3
RE: Skillbonus
Can i have question? Do I know you? because the first part of your script has a dubious but funny past. Big Grin

C# application developer.
C/C++,SQL,PLSQL programming.
Oracle database / information system developer.
Cooperation for development of new shard.
06-04-2013 08:52 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #4
RE: Skillbonus
Well, im sure we don't know each other. I started writing in sphere about half a year ago. Smile And I really dont remember your nick.
(This post was last modified: 06-04-2013 11:06 AM by Alaric.)
06-04-2013 11:05 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)