Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Rappelz > Rappelz Private Server
You last visited: Today at 15:25

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Script to add JP to a pet

Discussion on Script to add JP to a pet within the Rappelz Private Server forum part of the Rappelz category.

Reply
 
Old   #1
 
SilentBill's Avatar
 
elite*gold: 0
Join Date: Jun 2011
Posts: 305
Received Thanks: 178
Question Script to add JP to a pet

I'm currently working on something I thought would be handy.
With , I'm modding a Respec potion into giving the selected creature extra JPs in addition to the respec. The problem is the 'selected creature' part. I've already gotten the pot to add JPs to the first creature in formation, or even to add them to all creatures in formation, but I don't want that effect, since it favors pet classes and I want to keep it as fair as possible.

So, I come requesting some help. Anyone know the command to get the selected creature's handle in LUA?

Oh, and before I forget, i know it can easily be done via SQL, but I want this to be done in-game, without bothering the GMs.
SilentBill is offline  
Thanks
1 User
Old 09/23/2011, 10:30   #2
 
RoflcopterGoesSoiSoiSoi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 663
Received Thanks: 191
Quickly read over this, but I'd do some extensive looking in the breeder LUA script. It recursively lists the pets and selects one based on an ID. I'd assume you could BS your way through it and get it to work without errors.
RoflcopterGoesSoiSoiSoi is offline  
Old 09/24/2011, 09:27   #3
 
SilentBill's Avatar
 
elite*gold: 0
Join Date: Jun 2011
Posts: 305
Received Thanks: 178
Yeah, from going through the breeder script, I got the functions to get the creature handle and could easily infer how to add the JPs, no problem there. Thing is, the breeder doesn't care what pet you have selected, it cycles through your formation.
Therefore, I still don't know how to get the handle of the selected creature, which is needed as a parameter to add the JPs.
I've tried getting it from the 'main_summon' parameter/column/thingie and it seems to work, as long as it's the first one in formation, but then if you unsummon that one, and try the respec again on another pet, the first one in formation is the one that gets the bonus, not the selected one.
SilentBill is offline  
Old 10/10/2011, 04:18   #4
 
SilentBill's Avatar
 
elite*gold: 0
Join Date: Jun 2011
Posts: 305
Received Thanks: 178
I'd like to thank Kale as he was the only one who expressed any interest in actually helping.
In any case, I never did figure out how to get that damn handle, so I decided, fuck it, and just gave an NPC JP manipulation powers.
For the following, I'm gonna be as blunt as possible, if you can't get this to work, then maybe you shouldn't be messing with scripts at all. Moving on...
You need to add this to your favorite NPC's contact script
Code:
dlg_menu("[Insert menu item here]", "CreatureBuyJPMenu()")
And this is the actual function, it's probably crude as hell, but whatever, this is my first real foray with LUA.
Code:
	--========================================================================
	--             <<<<<< 4. Extra: Buy JPs for your pet with your own >>>>>>
	--========================================================================

function CreatureBuyJPMenu()
	local npc_id = get_npc_id()

	if npc_id == 7001 then --I gave it to the HV Breeder, so that's what this is for
		if is_premium() == false then
			return false
		end

		dlg_title("@90700100")
	end
	dlg_text_without_quest_menu("[Insert witty dialog here]")
	for i = 0, 5 do


		handle = 0
		handle = get_creature_handle( i )

		if handle ~= 0 and handle ~= nil then

			lv = get_creature_value( handle, "level" )
			petJp=get_creature_value( handle, "jp" )

			text = sconv("@90010009", "#@creature_name@#",tostring(get_creature_value( handle, "name" )) ,"#@creature_level@#",tostring(lv))

			command = 'Creature_Buy_JPS( ' .. handle .. ' )'

			dlg_menu( text, command )

		end
	end
	dlg_menu( "[Insert no thanks option here]", "" )

end

function Creature_Buy_JPS( handle )


			playerJPs = get_value("jp")
			petJp= get_creature_value( handle, "jp" )

	if playerJPs>=20000000 then --that is 20m JPs
		set_creature_value(handle, "jp", petJp+1)
		sv("jp", playerJPs-20000000)

	else
		dlg_title("@90700100")
		dlg_text("[Insert GTFO response here]")
		dlg_menu("[Insert player GTFO option here]", "")
        dlg_show()
	end
end
So, basically, it's a script that trades a character's JPs for one pet JP. I made it so 20m transform into 1, but up to you what value you wanna put in there. So there you go, no thanks to any one of you, it's working
SilentBill is offline  
Thanks
4 Users
Reply


Similar Threads Similar Threads
L2Walker script: Solo rebuff/restock/return script
08/08/2012 - Lin2 Exploits, Hacks, Bots, Tools & Macros - 63 Replies
Hello! I've been reading alot and not really contributing so i'll start off here with a very well working script im using to bot my SK outside ivory tower in oren. I've tried to structure the code so it easily can be modified for another level of character, town, and hunting spot. The script is made for CT2 Retail, mainly to get advantage of the newbie buffs (which now lasts all the way until level 62) Change log: Update 2008-09-01 Version 1.14 -Download
[suche] d2nt level rush script 1-25 / follow script
06/23/2010 - Diablo 2 Programming - 5 Replies
moin erstmal sry falls es da doch schon was passendes zu gab - hab schonmal gesucht aber nur alte sachen gefunden oder eben antworten in richtung "geht so schnell dafür braucht man keinen bot" ^^ mein problem besteht darin dass ich für lvl 1 bis 20 immer x stunden brauche - trist geht ja noch halberwegs aber mit tombruns such ich mich immer dusselig ^^ - bzw cows sind noch schlimmer (dafür geht das cow-script für d2nt ausm bluebird zumindest halberwegs) die frage ist jetz die - giebt...



All times are GMT +1. The time now is 15:26.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.