Page 1 of 1

auto-open gift bag on level?

Posted: Thu Sep 10, 2009 1:07 pm
by imartynasi
hello, im asking if its possible to set, when u level up it will auto open a gift bag.

Re: auto-open gift bag on level?

Posted: Thu Sep 10, 2009 3:54 pm
by d003232
imartynasi wrote:hello, im asking if its possible to set, when u level up it will auto open a gift bag.
Yes. Update to the current SVN version. There is a demo profile 'l1-10.xml'. There you find:

Code: Select all

	<onLeaveCombat>

		-- thats a demo for opening the gift bags from Lvl 1-10
		-- and levelup the skills for a new mage character
		-- you can delete that lines

		if( player.Level > player.free_counter1) then
			player.free_counter1 = player.Level;

			-- open giftbag and equipt content
			-- updates first 18 bag slots / update all if empty
			openGiftbag(player.Level, 18);

			-- levelup skills
			-- mage: 4 = third skill tab, 2 = mage flame
			-- priest: 2,1 (rising tide) 2,2 (urgent heal)
			-- CAUTION: addressing a invalid skill will crash the RoM client
			if(player.Class1 == CLASS_MAGE) then
				if(	player.Level == 2 ) then
					sendMacro("SetSpellPoint( 4, 2 );");
					yrest(1000);
					sendMacro("SetSpellPoint( 4, 2 );");
				else
					player.free_counter1 = player.Level;
					sendMacro("SetSpellPoint( 4, 2 );");
				end
			end

		end
The

Code: Select all

openGiftbag(player.Level, 18);
function is just beta. It is only complete for level 1-10 and at the moment only for 'cloth' classes (mage, priest). The database file 'giftbags.xml' have to be filled for other classes and the class depending coding lacks.

Re: auto-open gift bag on level?

Posted: Thu Sep 10, 2009 6:40 pm
by d003232

Code: Select all

openGiftbag();
now works for all classes from lvl 1 - 10.

Re: auto-open gift bag on level?

Posted: Fri Sep 11, 2009 3:33 am
by imartynasi
i had updated with SVN, but then bot not worked for me, so i downloaded and replaced everything, and now works without SVN

Re: auto-open gift bag on level?

Posted: Sun Sep 13, 2009 3:09 am
by droppen
d003232 wrote:

Code: Select all

openGiftbag();
now works for all classes from lvl 1 - 10.
I think openGiftbag(); should be inventory:openGiftbag() since its an inventory function, don't you think?

Re: auto-open gift bag on level?

Posted: Sun Sep 13, 2009 3:33 am
by d003232
droppen wrote:
d003232 wrote:

Code: Select all

openGiftbag();
now works for all classes from lvl 1 - 10.
I think openGiftbag(); should be inventory:openGiftbag() since its an inventory function, don't you think?
Yes. That would be a good idea. I suppose users will ask to open higher level gift bags too. If we move it ... and if we add giftbags greater lvl 10, then we should add a option to only open the bag and not to eqipt something. Now the function is very specialiced in supporting the automatic leveling from 1-10.

Re: auto-open gift bag on level?

Posted: Sun Sep 13, 2009 4:15 am
by d003232
I now renamed openGiftbag() to openGiftbags1To10(), to prepare the creation of a general inventory:openGiftbag and to make clear, that openGiftbags1To10 is something special.

So we can change/create the function inventory:openGiftbag later without disturbing the users.