PenUltima Online

It is currently Thu Sep 04, 2008 11:28 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: I need some support for a booster script!
PostPosted: Thu Aug 31, 2006 1:32 am 
Here there ive just got a shard up and running and i am having some difficulty with the booster script. I have a booster script where when a client logs in they can select 1 skill up to 130% and 1 stat to 130, but i am having trouble compiling it, keeps coming up with errors. Can someone please give me some helpful instructions or can someone supply me with a valid working booster script either for a stone, gate or for when clients log in.

Thankyou guys.


Top
  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 1:40 am 
the script i have is a working 093 script, can someone help me change it to a working 095, thanks..


Top
  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 8:32 am 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 747
Location: Chicago, IL USA
it would help if you posted the compiler error. It could be one of a huge number of things.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 6:53 pm 
/*
Author: MontuZ (MontuZ@aol.com) Feb 21, 2004.
Version: 1.0
Core: 093
Bugs: None. Atleast none that I know of..
PS: You know it was done by me when it's so clean.
*/

Use uo;
Use cfgfile;

Include "include/client";
Include "include/attributes";

Program OnUse_SkillStone( Who )

Var Boosted := GetObjProperty( who, "Detsoob" );
If( Boosted >= 2 )
SendSysmessage( who, "You've chosen 2 skills already.", FONT_NORMAL, 2595 );
Return;
Endif

Var mllayout := {
"Page 0",
"ReSizePic 350 200 3600 150 80",
"Text 390 220 2494 0",
"Button 370 222 2118 2117 1 0 1",
"Text 390 240 2494 1",
"Button 370 242 2118 2117 1 0 2",
};

Var mldata := {
"Boost Skills",
"Skip Boost",
};

Var Effect := SendDialogGump( who, mllayout, mldata );

If( !Effect )
SendSysMessage( who, "Cancelled.", FONT_NORMAL, 2600 );
Return;
Endif

Case( Effect[0] )

1:
ChangeFromSkillList( who );

2:
SetObjProperty( who, "SkippedBoost", 1 );
SendSysmessage( who, "Alrighty.", FONT_NORMAL, 2600 );

EndCase

EndProgram

Function ChangeFromSkillList( who )

Var layout2 := array(
"Page 0",
"ReSizePic 0 0 3600 250 450",
"Text 75 30 2494 0",
);

Var data2 := array(
"Select a Skill"
);

Var cfg := ReadConfigFile( ":combat:modenchantdesc" );
Var count := 0;
Var done := 0;
Var page := 1;
Var perpage := 17;
Var y := 55;
Var i;

layout2.append( "page " + page );
If( SKILLID__HIGHEST > perpage )
layout2.append( "Button 150 406 5540 5541 0 " + ( page + 1 ) );
Endif

For( i := 1; i <= SKILLID__HIGHEST + 1; i := i + 1 )
If( done == perpage )
done := 0;
page := page + 1;
y := 55;

layout2.append( "Page " + page );
layout2.append( "Button 80 406 5537 5538 0 " + ( page - 1 ) );
If( SKILLID__HIGHEST > ( count + perpage ) )
layout2.append( "button 150 406 5540 5541 0 " + ( page + 1 ) );
Endif
Endif

layout2.append( "Text 25 " + y + " 2597 " + len( data2 ) );
layout2.append( "Button 200 " + ( y + 5 ) + " 2104 2103 1 0 " + i );
data2.append( cfg[i-1].Skill );

y := y + 20;
done := done + 1;
count := count + 1;
Endfor

Var res := SendDialogGump( who, layout2, data2 );

If( !res[0] )
SendSysmessage( who, "Cancelled.", FONT_NORMAL, 2595 );
Return;
Endif

Var Boosted := GetObjProperty( who, "Detsoob" );

If( !Boosted )
SendSysMessage( who, "First Skill Set to 130", FONT_NORMAL, 2600 );
SetBaseSkillBaseValue( who, res[0]-1, 1300 );
SetObjProperty( who, "Detsoob", 1 );
ChangeFromSkillList( who );
Endif

If( Boosted >= 2 )
SendSysmessage( who, "You've chosen 2 skills already.", FONT_NORMAL, 2595 );
Elseif( Boosted == 2 )
EraseObjProperty( who, "Detsoob" );
SetObjProperty( who, "Detsoob", 3 );
Elseif( Boosted == 1 )
SendSysMessage( who, "Second Skill Set to 130", FONT_NORMAL, 2600 );
SetBaseSkillBaseValue( who, res[0]-1, 1300 );
EraseObjProperty( who, "Detsoob" );
SetObjProperty( who, "Detsoob", 2 );
BoostStat( Who );
Endif

EndFunction

Function BoostStat( Who )

// Text X = <- +>, Y = Up- Down+, Hue, Rank

Var mllayout := {
"Page 0",
"ReSizePic 350 200 3600 160 120",
"Text 370 220 2494 0",

"Text 390 240 2494 1",
"Button 370 245 2104 2103 1 0 1",

"Text 390 260 2494 2",
"Button 370 265 2104 2103 1 0 2",

"Text 390 280 2494 3",
"Button 370 285 2104 2103 1 0 3",
};

Var mldata := {
"( Boost a Stat )",
"Strength",
"Dexterity",
"Intelligence",
};

Var Effect := SendDialogGump( who, mllayout, mldata );

If( !Effect )
SendSysMessage( who, "Last chance to boost a stat.", FONT_NORMAL, 2600 );
BoostStat( Who );
Return;
Endif

Case( Effect[0] )

1:
SetBaseStrength( Who, 130 );
SendSysMessage( who, "Now choose a race.", FONT_NORMAL, 2600 );
2:
SetBaseDexterity( Who, 130 );
SendSysMessage( who, "Now choose a race.", FONT_NORMAL, 2600 );
3:
SetBaseIntelligence( Who, 130 );
SendSysMessage( who, "Now choose a race.", FONT_NORMAL, 2600 );

EndCase

EndFunction



If( Boosted >= 3 )
SendSysmessage( who, "You've chosen 2 skills already.", FONT_NORMAL, 2595 );
Elseif( Boosted == 2 )
EraseObjProperty( who, "Detsoob" );
SetObjProperty( who, "Detsoob", 3 );
Elseif( Boosted == 1 )
SendSysMessage( who, "Second Skill Set to 130", FONT_NORMAL, 2600 );
SetBaseSkillBaseValue( who, res[0]-1, 1300 );
EraseObjProperty( who, "Detsoob" );
SetObjProperty( who, "Detsoob", 2 );
BoostStat( Who );
Endif


Top
  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 7:22 pm 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 747
Location: Chicago, IL USA
the last 12 lines
Code:
If( Boosted >= 3 )
   SendSysmessage( who, "You've chosen 2 skills already.", FONT_NORMAL, 2595 );
Elseif( Boosted == 2 )
   EraseObjProperty( who, "Detsoob" );
   SetObjProperty( who, "Detsoob", 3 );
Elseif( Boosted == 1 )
   SendSysMessage( who, "Second Skill Set to 130", FONT_NORMAL, 2600 );
   SetBaseSkillBaseValue( who, res[0]-1, 1300 );
   EraseObjProperty( who, "Detsoob" );
   SetObjProperty( who, "Detsoob", 2 );
   BoostStat( Who );
Endif


are not within the program or a function...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 10:09 pm 
Offline
Distro Developer
User avatar

Joined: Fri Feb 10, 2006 8:08 am
Posts: 313
Location: Myrtle Beach, South Carolina
Quote:
MontuZ (MontuZ@aol.com) Feb 21, 2004.


LMFAO. That shit is old, that's like one of my first pieces of work. I'm sorry for such sad codemanship, lol.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 9:57 am 
Could someone please supply my shard with a working booster script, it would be greatly appreciated.


Top
  
 
 Post subject:
PostPosted: Mon Sep 04, 2006 8:34 am 
Offline

Joined: Thu Aug 10, 2006 6:38 am
Posts: 30
Unreal wrote:
Quote:
MontuZ (MontuZ@aol.com) Feb 21, 2004.


LMFAO. That shit is old, that's like one of my first pieces of work. I'm sorry for such sad codemanship, lol.


Yes i was using it on a 093 Pol server Called Sosarian Legends. Worked well.

Any Hints. Doc on how to convert it to a 095 base?

Needa get this baby running with 100 1 stat 100 1 skill.

all i can think of is using setskilbyattributes

but i suck at this,

Some one feel like chipping in?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 04, 2006 1:39 pm 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1122
Location: Southern Central USA
Try this script.

I whipped it out today. Did a little testing. I think it will do what you need. Boosts one chosen skill and one chosen stat.

Code:
/////////////////
// Boost skill
// Boosts chosen skill and stat
//
// Maintainer Yukiko
// Version 1.0
// date : 5-Sep-2006
/////////////////

use uo;
use cfgfile;
use os;
use util;
include "include/client";
include "include/objtype";
include "include/utility";
include "include/attributes";

const    SKILL_BOOST := 100;    // Skill boost amount
const    STAT_BOOST := 100;     // Stat Boost Amount

program boost ( who )

var input, skill, stat;

var choicelayout :=
    {
    "page 0",
    "resizepic 10 10 3600 525 575",
    "text 212 30 500 0",
    "button 30 70 2103 2104 1 0 1",
    "text 45 65 500 1",
    "button 30 95 2103 2104 1 0 2",
    "text 45 90 500 2",
    "button 30 120 2103 2104 1 0 3",
    "text 45 115 500 3",
    "button 30 145 2103 2104 1 0 4",
    "text 45 140 500 4",
    "button 30 170 2103 2104 1 0 5",
    "text 45 165 500 5",
    "button 30 195 2103 2104 1 0 6",
    "text 45 190 500 6",
    "button 30 220 2103 2104 1 0 7",
    "text 45 215 500 7",
    "button 30 245 2103 2104 1 0 8",
    "text 45 240 500 8",
    "button 30 270 2103 2104 1 0 9",
    "text 45 265 500 9",
    "button 30 295 2103 2104 1 0 10",
    "text 45 290 500 10",
    "button 30 320 2103 2104 1 0 11",
    "text 45 315 500 11",
    "button 30 345 2103 2104 1 0 12",
    "text 45 340 500 12",
    "button 30 370 2103 2104 1 0 13",
    "text 45 365 500 13",
    "button 30 395 2103 2104 1 0 14",
    "text 45 390 500 14",
    "button 30 420 2103 2104 1 0 15",
    "text 45 415 500 15",
    "button 30 445 2103 2104 1 0 16",
    "text 45 440 500 16",
    "button 30 470 2103 2104 1 0 17",
    "text 45 465 500 17",
    "button 30 495 2103 2104 1 0 18",
    "text 45 490 500 18",
    "button 30 520 2103 2104 1 0 19",
    "text 45 515 500 19",
    "button 30 545 2103 2104 1 0 20",
    "text 45 540 500 20",

    "button 210 70 2103 2104 1 0 21",
    "text 225 65 500 21",
    "button 210 95 2103 2104 1 0 22",
    "text 225 90 500 22",
    "button 210 120 2103 2104 1 0 23",
    "text 225 115 500 23",
    "button 210 145 2103 2104 1 0 24",
    "text 225 140 500 24",
    "button 210 170 2103 2104 1 0 25",
    "text 225 165 500 25",
    "button 210 195 2103 2104 1 0 26",
    "text 225 190 500 26",
    "button 210 220 2103 2104 1 0 27",
    "text 225 215 500 27",
    "button 210 245 2103 2104 1 0 28",
    "text 225 240 500 28",
    "button 210 270 2103 2104 1 0 29",
    "text 225 265 500 29",
    "button 210 295 2103 2104 1 0 30",
    "text 225 290 500 30",
    "button 210 320 2103 2104 1 0 31",
    "text 225 315 500 31",
    "button 210 345 2103 2104 1 0 32",
    "text 225 340 500 32",
    "button 210 370 2103 2104 1 0 33",
    "text 225 365 500 33",
    "button 210 395 2103 2104 1 0 34",
    "text 225 390 500 34",
    "button 210 420 2103 2104 1 0 35",
    "text 225 415 500 35",
    "button 210 445 2103 2104 1 0 36",
    "text 225 440 500 36",
    "button 210 470 2103 2104 1 0 37",
    "text 225 465 500 37",
    "button 210 495 2103 2104 1 0 38",
    "text 225 490 500 38",
    "button 210 520 2103 2104 1 0 39",
    "text 225 515 500 39",
    "button 210 545 2103 2104 1 0 40",
    "text 225 540 500 40",

    "button 390 70 2103 2104 1 0 41",
    "text 405 65 500 41",
    "button 390 95 2103 2104 1 0 42",
    "text 405 90 500 42",
    "button 390 120 2103 2104 1 0 43",
    "text 405 115 500 43",
    "button 390 145 2103 2104 1 0 44",
    "text 405 140 500 44",
    "button 390 170 2103 2104 1 0 45",
    "text 405 165 500 45",
    "button 390 195 2103 2104 1 0 46",
    "text 405 190 500 46",
    "button 390 220 2103 2104 1 0 47",
    "text 405 215 500 47",
    "button 390 245 2103 2104 1 0 48",
    "text 405 240 500 48",
    "button 390 270 2103 2104 1 0 49",
    "text 405 265 500 49",
    "button 390 295 2103 2104 1 0 50",
    "text 405 290 500 50"
    };


     var choicedata :=
    {
    "alchemy",
    "anatomy",
    "animallore",
    "archery",
    "armslore",
    "begging",
    "blacksmithy",
    "bowcraft",
    "camping",
    "carpentry",
    "cartography",
    "cooking",
    "detectinghidden",
    "enticement",
    "evaluatingintelligence",
    "evalint",
    "fencing",
    "fishing",
    "forensicevaluation",
    "healing",
    "herding",
    "hiding",
    "inscription",
    "itemid",
    "lockpicking",
    "lumberjacking",
    "macefighting",
    "magery",
    "magicresistance",
    "meditation",
    "mining",
    "musicianship",
    "parry",
    "peacemaking",
    "poisoning",
    "provocation",
    "removetrap",
    "snooping",
    "spiritspeak",
    "stealing",
    "stealth",
    "swordsmanship",
    "tactics",
    "tailoring",
    "animaltaming",
    "tasteidentification",
    "tinkering",
    "tracking",
    "veterinary",
    "wrestling"
    };
     var name :=
     {
     "Choose skill:",
    "alchemy",
    "anatomy",
    "animallore",
    "archery",
    "armslore",
    "begging",
    "blacksmithy",
    "bowcraft",
    "camping",
    "carpentry",
    "cartography",
    "cooking",
    "detectinghidden",
    "enticement",
    "evaluatingintelligence",
    "evalint",
    "fencing",
    "fishing",
    "forensicevaluation",
    "healing",
    "herding",
    "hiding",
    "inscription",
    "itemid",
    "lockpicking",
    "lumberjacking",
    "macefighting",
    "magery",
    "magicresistance",
    "meditation",
    "mining",
    "musicianship",
    "parry",
    "peacemaking",
    "poisoning",
    "provocation",
    "removetrap",
    "snooping",
    "spiritspeak",
    "stealing",
    "stealth",
    "swordsmanship",
    "tactics",
    "tailoring",
    "animaltaming",
    "tasteidentification",
    "tinkering",
    "tracking",
    "veterinary",
    "wrestling"
    };
   
   
    input := SendDialogGump( who, choicelayout, name);
    input := input[0];
    skill := choicedata[input];
    SetAttributeBaseValue(who, skill, Cint(SKILL_BOOST * 10));

    SendSysMessage (who, skill);

    choicedata :=
    {
        "dexterity",
        "intelligence",
        "strength"
    };
   
    name :=
    {
        "Choose Stat:",
        "dexterity",
        "intelligence",
        "strength"
    };
   
    choicelayout :=
    {
    "page 0",
    "resizepic 10 10 3600 200 150",
    "text 50 30 500 0",
    "button 30 70 2103 2104 1 0 1",
    "text 45 65 500 1",
    "button 30 95 2103 2104 1 0 2",
    "text 45 90 500 2",
    "button 30 120 2103 2104 1 0 3",
    "text 45 115 500 3"
    };
   
    input := SendDialogGump( who, choicelayout, name);
    input := input[0];
    stat := choicedata[input];
    SetAttributeBaseValue(who, stat, STAT_BOOST * 10);
    DoRecalcVitals(who);

endprogram

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 04, 2006 9:57 pm 
Offline

Joined: Thu Aug 10, 2006 6:38 am
Posts: 30
Nice ill give it a go!

Fucken Champ!!! Again im Sitting here Thanking you.. lol

i need learn to script better eheh only basic atm.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 05, 2006 3:57 am 
Offline

Joined: Thu Aug 10, 2006 6:38 am
Posts: 30
Bad news?

Code:
Compiling: C:\Pol\pkg\opt\Booster\booster.src
Token '(' cannot follow token 'DoRecalcVitals'
Function DoRecalcVitals() is not defined.
Error compiling statement at C:\Pol\pkg\opt\Booster\booster.src, Line 284
Error detected in program body.
Error occurred at C:\Pol\pkg\opt\Booster\booster.src, Line 284
Execution aborted due to: Error compiling file


Compileing error....
can any1 help thats same sorta thing i got on my script


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 05, 2006 5:24 pm 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1122
Location: Southern Central USA
The script is written using POL 95 Distro attributes.inc file.

The function DoRecalcVitals I'll post below. Make sure it is in the attributes.inc file on your system.

Code:
Function DoRecalcVitals( mob )
  set_critical(1);
  if(mob.acctname)
    if(mob.ip)
      RecalcVitals(mob);
    endif
  else
    RecalcVitals(mob);
  endif
  set_critical(0);
endfunction

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl