PenUltima Online

It is currently Sun Sep 07, 2008 2:43 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Servers up, need scripting help.
PostPosted: Mon Apr 17, 2006 7:33 am 
Offline

Joined: Sat Apr 08, 2006 4:09 am
Posts: 28
Hi!
The Servers kind of working fine now, but we need some things.

I would like to know how to make an item, that when used creates something in your backpack. Maybe this is a script, but I dont think it would be very hard for a scripter to make this. Maybe it can be done with a command, I dont know.

I would for example want a statue, that when doubleclicked sets ALL your skills to 100, and creates a full armor in your backpack, along with a full spellbook, and like 100 of each reagent.


Also, I would like to know how to set a timer on a gate.
My shard is a temporary PvP shard, so all players will have max skills, and I will not let them outside a small area. Therefore I would like to know how to make a 10 second timer on a gate before it teleports you, so that people cannot escape from fights so easily.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 8:30 am 
Offline

Joined: Mon Feb 06, 2006 6:12 am
Posts: 93
this is based on distro... because thats where most the scripts were stolen from :P i was to lazy to script it all myself :)
Code:
use os;
use uo;

const UOBJ_REG_START := 0xf78;
const UOBJ_REG_END := 0xf91;

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

program use_stone(who)
setskills(who, 100);
makeregs(who, 100);
spellbook(who);
makearmour(who);
endprogram


function setskill( who, amount )
var i;
for (i := 0; i <= SKILLID__HIGHEST; i := i + 1)

        print( "Setting Skill " + i + " to "+amount );
        var res := SetBaseSkillBaseValue( who, i, amount*10 );
        if (res == error)
            SendSysMessage( who, "Unable to set skill: " + res.errortext );
        else
            SendSysMessage( who, "New Effective Skill: " + GetEffectiveSkill(who,i) );
        endif
    endfor
endfunction

function makeregs(who, amount)
  amount := CInt(amount);
  if(!amount)
    amount := 20;
  endif
  var backpack := CreateItemInBackpack(who, "backpack", 1);
  backpack.color := 0x3;
  foreach thing in array( 0x0f7a, 0x0f7b, 0x0f84, 0x0f85, 0x0f86, 0x0f88, 0x0f8c, 0x0f8d )
    CreateItemInContainer(backpack, thing, amount);
  endforeach
endfunction

function spellbook( who )
//create normal book
    var book := CreateItemInBackpack(who,0x0efa, 1);
    var i;
    for (i := 0x1f2d; i <= 0x1f6c; i := i + 1)
        CreateItemInContainer(book,  i, 1);
    endfor

endfunction

function makearmour(who)
CreateItemInBackpack(who,0x1412, 1); //helm
CreateItemInBackpack(who,0x1415, 1); //breast
CreateItemInBackpack(who,0x1410, 1); //arms
CreateItemInBackpack(who,0x1411, 1); //legs
CreateItemInBackpack(who,0x1414, 1); //gloves
CreateItemInBackpack(who,0x1413, 1); //gorget
CreateItemInBackpack(who,0x1B76, 1); //heater shield
endfunction


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 8:33 am 
Offline

Joined: Mon Feb 06, 2006 6:12 am
Posts: 93
oh and use a sleep(<time in seconds>); to make it wait eg for 10 seconds sleep(10); but i think you also need to add USE OS to make it sleep :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 9:05 am 
Offline

Joined: Sat Apr 08, 2006 4:09 am
Posts: 28
Guys Im sorry but Im really not a scripter, can you explain what to do more exactly?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 9:57 am 
Offline

Joined: Sat Apr 15, 2006 11:50 am
Posts: 66
Hi Lunne -_-


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 10:01 am 
Offline

Joined: Sat Apr 08, 2006 4:09 am
Posts: 28
Hello Damien


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 6:32 pm 
Offline

Joined: Mon Feb 06, 2006 6:12 am
Posts: 93
http://forums.polserver.com/viewtopic.php?p=1233#1233

that link will take you to a package i made for you to do exactly what you want with a few minor changes. please feel free to download it and use it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 12:41 am 
Offline

Joined: Sat Apr 08, 2006 4:09 am
Posts: 28
Thanks a lot!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 12:41 am 
Offline

Joined: Sat Apr 08, 2006 4:09 am
Posts: 28
By the way, how can I make it so you also get a tamed horse?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 1:10 am 
Offline

Joined: Sat Apr 08, 2006 4:09 am
Posts: 28
Erm Which file should I change stuff in. I changed stuff in use_statue.src but it didnt affect anything.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 1:28 am 
Offline

Joined: Mon Feb 06, 2006 6:12 am
Posts: 93
itemdesc is where you wanna change the looks of the item and color etc
asfor the mount add this line in use_statue.src in the program use_statue

Code:
EquipItem(who,0x3ea2);


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 1:40 am 
Offline

Joined: Sat Apr 08, 2006 4:09 am
Posts: 28
Thanks! But I also want to create a some weapons in the backpack.If you have MSN it would rock to get it, so I dont have to wait 2 hours for each answer.


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: No registered users 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl