Open the js/item/kindling.js and change the the onUse function so that it looks like this:
Code: Select all
function onUseChecked( pUser, iUsed )
{
var pSock = pUser.socket;
// is it on the ground
var iCont = 0;
if( iUsed.container != null )
{
pUser.SysMessage( GetDictionaryEntry( 1763, pSock.Language ));
return false;
}
var CampingAttempt = pUser.skills.camping / 10;
var Success = RandomNumber( 0, 100 );
if( pUser.CheckSkill( 10, 0, 1000 ))
{
iUsed.movable = 2;
iUsed.id = 0x0de3;
iUsed.dir = 29; //Set light radius to 29
pUser.SysMessage( GetDictionaryEntry( 1765, pSock.Language ));
iUsed.StartTimer( 60000, 1, true ); //Campfire burns for 60 seconds
}
else
pUser.SysMessage( GetDictionaryEntry( 1764, pSock.Language ));
return false;
}
Code: Select all
function onUseChecked( pUser, iUsed )
{
iUsed.id = 0x0de9; // turn campfire into embers
iUsed.dir = 2; //Set light radius to 2
iUsed.StartTimer( 15000, 1, true ); //Embers last for 15 seconds
return false;
}
function onTimer( campfire, timerID )
{
if( timerID == 1 )
{
campfire.id = 0x0dea; // turn embers into burnt wood
campfire.decayable = true;
}
}
Code: Select all
5008=item/kindling.js
5009=item/campfire.js
Code: Select all
5007=item/archerybutte.js
And these lines:
Code: Select all
//Kindling
0x0DE1=5008
//Campfire
0x0de3=5009
Code: Select all
//Pickpocket Dips
0x1EC0=5006
0x1EC3=5006
Finally add these lines into the dictionarys:
Code: Select all
1763=You have to place the kindling on the ground.
1764=Your skill is to low to use this.
1765=You have started a campfire.
It still has some things that need to get worked out:
- Skill increase on succesfull and failed attempts.
- If the user logs out while the fire is burning the timers seem to stop, so the only way to stop the fire is by using it again.(Maybe a bug in the script engine?)
- The fire doesn't secure the area (I don't know how to do this).
- The onCollide doesn't seem to work, so you can't burn yourself when running through the fire.
- Making shure only the one who started it can stop it, just in case.
- And probably more things I forgot.