Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Rappelz > Rappelz Private Server
You last visited: Today at 23:52

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

 

request for a script

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2012
Posts: 9
Received Thanks: 1
request for a script

i want a rappelz script that gives u
a gift in your bag every hour of playing



zartin is offline  
Old   #2
 
elite*gold: 0
Join Date: Oct 2010
Posts: 2,557
Received Thanks: 2,412
Write a script called

function on_every_hour()
-- Logic
end

and create a scheduledcommand entry to fire that script every hour. (Thought I'm sure it won't be able to do targeted cmd's like insert_item, I could be wrong though)


ismokedrow is offline  
Thanks
1 User
Old   #3
 
elite*gold: 0
Join Date: May 2013
Posts: 129
Received Thanks: 12
I did some testing on scheduledcommand if the change type from 0 to 1 will appear as notice if the value 0 is the command but can not get it applied whether buff or tool
thund22222 is offline  
Old   #4
 
elite*gold: 0
Join Date: Oct 2011
Posts: 10
Received Thanks: 11
NFlavor did something like this for a login event in 2014.

The way I understand it, the function 'on_time_based_event_reward()' (NPC_Event.lua) is run periodically for any player who has been logged in for a certain period of time if the environment variable 'game.use_time_based_event_script' is set.
This is done automatically on startup (assuming it wasn't removed from 'on_server_init()') by 'for_event_by_liveteam()' (NPC_Event.lua):
Code:
	set_env( "game.use_time_based_event_script",1 )
	set_env( "game.term_for_time_based_event_script",120 )
...where 120 is the required login period in minutes.

For example, if you set game.term_for_time_based_event_script to 5 and add the line insert_item(900000,1) to on_time_based_event_reward() without any further conditions, any player on the server will receive 1 stamina saver for every five minutes they are logged on.


Dark.Gts is offline  
Thanks
6 Users
Old   #5
 
elite*gold: 0
Join Date: May 2013
Posts: 129
Received Thanks: 12
Thank you very much, but you should be Put the function in on_server_init?
thund22222 is offline  
Old   #6
 
elite*gold: 0
Join Date: Oct 2011
Posts: 10
Received Thanks: 11
Assuming your LUAs haven't been modified you won't have to add anything besides your own code. This is the important stuff:

server_init.lua:
Code:
[...]
function on_server_init()
	[...]
	for_event_by_liveteam() --라이브팀 사용 범위로 NPC_EVENT 스크립트에서 사용된다.
end
[...]
NPC_Event.lua:
Code:
[...]
function for_event_by_liveteam()

	play_time_event() --플레이 타임 이벤트
	[...]
end

function play_time_event()

	[...]
		set_env( "game.use_time_based_event_script",1 )
		set_env( "game.term_for_time_based_event_script",120 )
		--change the value above to your desired interval in minutes!
	[...]
end

function on_time_based_event_reward() 

	local state_code = get_local_info()  -- 국가코드
	local pcbang_grade = get_value("pcbang_user")	-- 프리미엄PC방 판단변수	
	local t_flag = get_flag( "reward_time_event" ) -- 캐릭터 별 플래그 값
	local account_t_flag = get_account_flag( "reward_time_event" ) -- 계정 별 플래그 값
	local current_time = get_os_date( "%Y-%m-%d %H:%M:%S" )
	local flag_current_time = get_os_date( "%Y-%m-%d" )
	local event_current_week = 0	
	local lv = get_value( "level" )

	--add your own code below!

	[...]
end
[...]


Dark.Gts is offline  
Thanks
3 Users
Reply



« Previous Thread | Next Thread »

Similar Threads
[Request] Script
It's possible to send coins to all players in database ? Can anyone help me with script ?
3 Replies - Dekaron Private Server
[Request]Script
Hello, I would like, if possible, if create one script for recruiting friends,as official server! Thank you in advance! eXcCeSs Sorry for...
2 Replies - Metin2 PServer Guides & Strategies
AHK script request
I did not see a AHK forum area, just autoit. Can someone make me a script that while holding down F, it will continuously scan the center of my...
0 Replies - General Coding
[Request] Script TUT
Is there a simple script editing tut. I tried the whole Kom extractor thing and using python but I'm not getting it, I type in Script without .kom...
1 Replies - Grand Chase
[REQUEST] Can i Request A Acc/Char PHP Script
hello i was wondering if anyone have made a acc/char creation page in one yet? is so can anyone release itplease?
6 Replies - CO2 PServer - Discussions / Questions



All times are GMT +2. The time now is 23:52.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.