A La Kale: Hidden Village Buffer (Release)

08/05/2011 09:15 RoflcopterGoesSoiSoiSoi#16
Run this SQL query and restart your server to fix the NPC locations.
Code:
USE
Arcadia
GO

UPDATE [dbo].[NPCResource] SET x='221311',  y='20575' WHERE id='11225' 
UPDATE [dbo].[NPCResource] SET x='222541', y='20331' WHERE id='7025'
Thanks for the bug report, I'm surprised this wasn't reported earlier.
08/05/2011 09:59 Ayumilove#17
1) Before SQL Query for NPC Location Fix :

[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]

2) After SQL Query for NPC LOcation Fix :

[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]



3) My NPC Buff.lua :

Code:
function get_module_name()
             return "NPC_Buff"
end

   --============================================================
   --                <<<<<< 1. Druid Kart >>>>>>
   --============================================================
function hidden_village_buffer()
	local npc_id = get_npc_id()
	if npc_id == 11225 then
	dlg_title("Madosa Kart")
	else
	dlg_title("Druid Kart")
	end
	
	if is_premium() then
		dlg_text("Would you like some buffs?")
		dlg_menu("Can you please buff me?", "druid_kart_select_player()")
		dlg_menu("Can you please buff my creature?", "druid_kart_select_creature()")
		dlg_menu("Goodbye!", "")
		dlg_show()
	else
		is_not_premium_error()
	end
end

function druid_kart_select_player()
	local npc_id = get_npc_id()
	if npc_id == 11225 then
	dlg_title("@105011225")
	else
	dlg_title("Druid Kart")
	end
	if is_premium() then
		dlg_text("Which buff do you want?")
		dlg_menu("Physical Attack - 1,000R", "druid_kart_give_player(1007)")
		dlg_menu("Magical Attack - 1,000R", "druid_kart_give_player(1008)")
		dlg_menu("Physical Defense - 1,000R", "druid_kart_give_player(1009)")
		dlg_menu("Magical Defense - 1,000R", "druid_kart_give_player(1010)")
		dlg_menu("Attack Speed - 1,000R", "druid_kart_give_player(1011)")
		dlg_menu("Cast Speed - 1,000R", "druid_kart_give_player(1012)")
		dlg_menu("Movement Speed - 1,000R", "druid_kart_give_player(1013)")
		dlg_menu("Get All Buffs - 7,000R", "druid_kart_give_player(0)")
		dlg_menu("Nevermind.", "hidden_village_buffer()")
		dlg_menu("Goodbye!", "")
		dlg_show()
	else
		is_not_premium_error()
	end
end

function druid_kart_select_creature()
	local npc_id = get_npc_id()
	if npc_id == 11225 then
	dlg_title("Madosa Kart")
	else
	dlg_title("Druid Kart")
	end
	if is_premium() then
		dlg_text("Which buff do you want?")
		dlg_menu("Physical Attack - 1,000R", "druid_kart_give_creature(1007)")
		dlg_menu("Magical Attack - 1,000R", "druid_kart_give_creature(1008)")
		dlg_menu("Physical Defense - 1,000R", "druid_kart_give_creature(1009)")
		dlg_menu("Magical Defense - 1,000R", "druid_kart_give_creature(1010)")
		dlg_menu("Attack Speed - 1,000R", "druid_kart_give_creature(1011)")
		dlg_menu("Cast Speed - 1,000R", "druid_kart_give_creature(1012)")
		dlg_menu("Movement Speed - 1,000R", "druid_kart_give_creature(1013)")
		dlg_menu("Get All Buffs - 7,000R", "druid_kart_give_creature(0)")
		dlg_menu("Nevermind.", "hidden_village_buffer()")
		dlg_menu("Goodbye!", "")
		dlg_show()
	else
		is_not_premium_error()
	end
end

function druid_kart_give_player(buffcode)
	local npc_id = get_npc_id()

		if npc_id == 11225 then
			dlg_title("Madosa Kart")
		else
			dlg_title("Druid Kart")
		end

	local gold = get_value("gold")
	gold = tonumber(gold)
	if buffcode == 0 then
		if gold >= 7000 then
			sv("gold", gold-7000)
			update_gold_chaos()
			add_state(1007, 6, 900000)
			add_state(1008, 6, 900000)
			add_state(1009, 6, 900000)
			add_state(1010, 6, 900000)
			add_state(1011, 6, 900000)
			add_state(1012, 6, 900000)
			add_state(1013, 6, 900000)
			druid_kart_select_player()
		else
			dlg_text("Sorry, you do not have enough money.")
			dlg_menu("Goodbye!", "")
			dlg_show()
		end
	else
		if gold >= 1000 then
			sv("gold", gold-1000)
			update_gold_chaos()
			add_state("" .. buffcode .. "", 6, 900000)
			druid_kart_select_player()
		else
			dlg_text("Sorry, you do not have enough money.")
			dlg_menu("Goodbye!", "")
			dlg_show()
		end
	end
end

function druid_kart_give_creature(buffcode)
	local npc_id = get_npc_id()
	if npc_id == 11225 then
	dlg_title("Madosa Kart")
	else
	dlg_title("Druid Kart")
	end
	local gold = get_value("gold")
	gold = tonumber(gold)
	if buffcode == 0 then
		if gold >= 7000 then
			sv("gold", gold-7000)
			update_gold_chaos()
			add_cstate(1007, 6, 900000)
			add_cstate(1008, 6, 900000)
			add_cstate(1009, 6, 900000)
			add_cstate(1010, 6, 900000)
			add_cstate(1011, 6, 900000)
			add_cstate(1012, 6, 900000)
			add_cstate(1013, 6, 900000)
			druid_kart_select_creature()
		else
			dlg_text("Sorry, you do not have enough money.")
			dlg_menu("Goodbye!", "")
			dlg_show()
		end
	else
		if gold >= 1000 then
			sv("gold", gold-1000)
			update_gold_chaos()
			add_cstate("" .. buffcode .. "", 6, 900000)
			druid_kart_select_creature()
		else
			dlg_text("Sorry, you do not have enough money.")
			dlg_menu("Goodbye!", "")
			dlg_show()
		end
	end
end
end
08/05/2011 10:21 longiness#18
Yea I got the same problem with Ayumilove after I use your new query that moves Medosa NPC to another place
08/05/2011 10:27 RoflcopterGoesSoiSoiSoi#19
You have an extra "end" at the bottom of the LUA script. Remove it.

(@ayumi + longiness)
08/05/2011 10:48 Ayumilove#20
Quote:
Originally Posted by RoflcopterGoesSoiSoiSoi View Post
You have an extra "end" at the bottom of the LUA script. Remove it.

(@ayumi + longiness)
Thanks you ; ) It is working like a charm now !

Keep up the good work !
08/05/2011 11:17 longiness#21
That doesn't help to me :( just wonder if it works on the server 6.1 release from Wisp?
08/06/2011 14:41 rockfan#22
please Can SomeBody Tell Me Where I can Find "NPC_buff.lua"
i Can't Find it
THx
08/06/2011 14:47 Cieldaron#23
Resource -> Script -> NPC Buff(...).lua
08/06/2011 19:14 lawlywood#24
well i know noobs dont use the board search. But the windows search? cmon guys, u even manage to find the epvp board, how did you do that?

You know there is google desktop out there: You can google your fucking pc too, if you dont like the "normal" search:confused:
08/06/2011 19:17 Ranma014#25
Quote:
Originally Posted by lawlywood View Post
well i know noobs dont use the board search. But the windows search? cmon guys, u even manage to find the epvp board, how did you do that?

You know there is google desktop out there: You can google your fucking pc too, if you dont like the "normal" search:confused:
Youre right, although I wouldnt suggest using google desktop. Its like selling your soul to the devil.
08/06/2011 19:40 h96vy#26
do not release it to noobs
08/06/2011 20:06 longiness#27
I found my problem about "attempt to call NPC global" (I applied to the wrong files from my old version server that I forgot to remove before the new one immigrated) but since I applied the code, the problem is getting worse that I can not use hidden village pass. It doesn't pop up. Anyone knows how to fix it? I would appreciate that :)
08/06/2011 22:11 Ayumilove#28
Quote:
Originally Posted by longiness View Post
I found my problem about "attempt to call NPC global" (I applied to the wrong files from my old version server that I forgot to remove before the new one immigrated) but since I applied the code, the problem is getting worse that I can not use hidden village pass. It doesn't pop up. Anyone knows how to fix it? I would appreciate that :)

Remove this at the bottom of your etc_script_function.lua file :

Code:
function is_premium()
	local hvbuff = get_state_level("9004")
	if hvbuff >= 1 then
		return true
	else
		return false
	end
end

function is_not_premium_error()
	dlg_text("I'm sorry, but we only provide services to those with a Hidden Village pass.")
	dlg_menu("Goodbye!", "")
	dlg_show()
end
Because you already have the function premium at the top of the lua file.

Recompile the lua and then re-run GameServer.

Hope this helps
08/07/2011 13:07 lawlywood#29
#Reported for pushing

srsly what the heck are you doing? why are you pushing solved threads? With no question? why should anyone answer here?
08/07/2011 19:21 SilentBill#30
More a suggestion than a bug, Atk Speed gives 12% as opposed to all the other buffs, so, change the 1011 buff line from lvl 6 to lvl 9, so every buff is 18%. At least, that's what I did, cheers.