|
You last visited: Today at 18:16
Advertisement
Give Item on level up, need help with code?
Discussion on Give Item on level up, need help with code? within the Rappelz Private Server forum part of the Rappelz category.
10/25/2011, 06:23
|
#1
|
elite*gold: 0
Join Date: Jun 2008
Posts: 86
Received Thanks: 1
|
Give Item on level up, need help with code?
This code I have altered is suppose to give a rupee lotto box every 5 levels and also give rupee bags everytime rank up. Doesn't seem to work anyone have an idea on what im missing?
This is what I have placed inside of the player_level_up lua:
Code:
function get_module_name()
return "on_player_level_up"
end
function on_player_level_up()
--local tx, ty, current_x, island_number
local lv = get_value( "level" )
if lv == 5 then
-- °¢ 1¹ø ¼¶ÀÇ ÅÚ·¹Æ÷Æ® ÁÂÇ¥
-- tx = 30315
-- ty = 5480
-- ÇöÀç±Íȯ À§Ä¡¸¦ °¡Á®¿È.
current_x = get_flag( "rx" )
-- ¸î ¹ø ° ¼¶ÀÎÁö È®ÀÎ.
-- local i
-- for i = 1, 6 do
-- if current_x < ( 18816 * (i-1) + tx) and current_x + 3000 > ( (18816 * (i-1) + tx) - 10000) then
-- island_number = i
-- end
-- end
-- ±ÍȯÁö¿ªÀ» ÇöÀç Ãʺ¸ÀÚ¼¶ Ä·ÇÁÀ¸·Î ¼³Á¤
set_flag( "rx", 172543 + math.random(0,100))
set_flag( "ry", 51847 + math.random(0,100))
end
-- ±¹°¡ ÄÚµå Àоî¿À±â
-- get_local_info()ÀÇ ¹Ýȯ°ªµé
--LOCAL_INFO_KOREA = 1
--LOCAL_INFO_HONGKONG = 2
--LOCAL_INFO_AMERICA = 4
--LOCAL_INFO_GERMANY = 8
--LOCAL_INFO_JAPAN = 16
--LOCAL_INFO_TAIWAN = 32
--LOCAL_INFO_CHINA = 64
--LOCAL_INFO_FRANCE = 128
--LOCAL_INFO_RUSSIA = 256
local state_code = get_local_info()
-- 18·¹º§ ÀÌ»óÀ̳ª ¼ö·ÃÀÚÀÇ ¼¶ ³»¿¡ ÀÖ´Â °æ¿ì Á¾Á· ¸¶À»·Î ±Íȯ ÁöÁ¡ ¼³Á¤
local current_x = gv("x")
local current_y = gv("y")
local race = get_value( "race" )
-- ¹Ì±¹ÀÌ¸é ¹«Á¶°Ç ¾Èº¸³¿ (Àü ±¹°¡ Àû¿ë ¾ÈÇÔÀ¸·Î º¯°æ 08.07.29)
if state_code == 511 then
-- ¾Æ¹«Áþµµ ¾ÈÇØ¿ä
elseif lv >= 18 then
-- ¼ö·ÃÀÚÀÇ ¼¶¿¡ ÀÖ´ÂÁö ¿©ºÎ üũ
if current_x >= 161280 and current_x <= 177408 then
if current_y >= 48384 and current_y <= 64512 then
-- ÇöÀç±Íȯ À§Ä¡¸¦ °¡Á®¿È.
local return_x = get_flag( "rx" )
local return_y = get_flag( "ry" )
-- ¼ö·ÃÀÚÀÇ ¼¶ÀÌ ±ÍȯÀÎÁö üũ
if return_x == 173183 and return_y == 52299 then
-- ±ÍȯÁö¿ªÀ» ÇØ´ç Á¾Á· ¸¶À»·Î ¼³Á¤
-- µ¥¹ÙÀÏ °æ¿ì
if race == 4 then
set_flag( "rx", 6625 + math.random(0,100))
set_flag( "ry", 6980 + math.random(0,100))
-- ¾Æ¼ö¶óÀÏ °æ¿ì
elseif race == 5 then
set_flag( "rx", 116799 + math.random(0,100))
set_flag( "ry", 58205 + math.random(0,100))
-- °¡À̾ÆÀÏ °æ¿ì
else
set_flag( "rx", 153513 + math.random(0,100))
set_flag( "ry", 77203 + math.random(0,100))
end -- if race == 4 then
-- ¼ö·ÃÀÚÀÇ ¼¶¿¡ ÀÖ°í 18·¹º§ ÀÌ»óÀ̱⠶§¹®¿¡ ÇØ´ç Á¾Á· ¸¶À»·Î °*Á¦ ±Íȯ ¼³Á¤ µÆ´Ù´Â ¸Þ½ÃÁö ³¯¸².
message( "@235")
end -- if return_x == 173183 and return_y == 52299
end -- if current_y >= 48384 and current_y <= 64512 then
end -- if current_x >= 161280 and current_x <= 177408 then
end -- if lv >= 18 then
-- ¿ÀÅä·Î ¼¼ÆÃµÈ ij¸¯ÅͶó¸é Àú ¸Ö¸® ³¯·Á ¹ö¸®ÀÚ~
kick_auto_to_another_world()
-- ¼ö·ÃÀÚ ¼¶¿¡ ÀÖ´Â ¿ÀÅäµéÀº º»Åä·Î ³¯·Á ¹ö¸®ÀÚ
local current_x = gv("x")
local current_y = gv("y")
local race = get_value( "race" )
if current_x >= 161280 and current_x <= 177408 then
if current_y >= 48384 and current_y <= 64512 then
local is_auto, quest_count
quest_count, is_auto = anti_auto_quest_check()
if is_auto then
if race == 4 then
RunTeleport_Auto_TO_City( 6625 , 6980 )
elseif race == 5 then
RunTeleport_Auto_TO_City( 116799 , 58205 )
else
RunTeleport_Auto_TO_City( 153506 , 77175 )
end
end -- if is_auto then
end -- if current_y >= 48384 and current_y <= 64512 then
end -- if current_x >= 161280 and current_x <= 177408 then
save()
-- ·¹º§¾÷ ´Þ¼º À̺¥Æ® ó¸®
-- ±¹°¡ ÄÚµå Àоî¿À±â
-- get_local_info()ÀÇ ¹Ýȯ°ªµé
--LOCAL_INFO_KOREA = 1
--LOCAL_INFO_HONGKONG = 2
--LOCAL_INFO_AMERICA = 4
--LOCAL_INFO_GERMAN = 8
--LOCAL_INFO_JAPAN = 16
--LOCAL_INFO_TAIWAN = 32
--LOCAL_INFO_CHINA = 64
--LOCAL_INFO_FRANCE = 128
--LOCAL_INFO_RUSSIA = 256
--LOCAL_INFO_MALAYSIA = 512
--LOCAL_INFO_SINGAPORE = 1024
--LOCAL_INFO_VIETNAM = 2048
--LOCAL_INFO_THAILAND = 4096
--LOCAL_INFO_MIDEAST = 8192
--LOCAL_INFO_TURKEY = 16384
local state_code = get_local_info()
if state_code == 8 or state_code == 128 then
local max_reached_level = gv( "max_reached_level" )
local i
for i = max_reached_level + 1 , lv do
if i == 5 then
insert_item( 3600004, 1 )
elseif i == 10 then
insert_item( 3600004, 1 )
elseif i == 15 then
insert_item( 3600004, 1 )
elseif i == 20 then
insert_item( 3600003, 2 )
elseif i == 25 then
insert_item( 3600004, 1 )
elseif i == 30 then
insert_item( 3600004, 1 )
elseif i == 35 then
insert_item( 3600004, 1 )
elseif i == 40 then
insert_item( 3600004, 1 )
elseif i == 45 then
insert_item( 3600004, 1 )
elseif i == 50 then
insert_item( 3600003, 3 )
elseif i == 55 then
insert_item( 3600004, 1 )
elseif i == 60 then
insert_item( 3600004, 1 )
elseif i == 65 then
insert_item( 3600004, 1 )
elseif i == 70 then
insert_item( 3600004, 1 )
elseif i == 75 then
insert_item( 3600004, 1 )
elseif i == 80 then
insert_item( 3600003, 4 )
elseif i == 85 then
insert_item( 3600004, 1 )
elseif i == 90 then
insert_item( 3600004, 1 )
elseif i == 95 then
insert_item( 3600004, 1 )
elseif i == 100 then
insert_item( 3600003, 5 )
elseif i == 105 then
insert_item( 3600004, 1 )
elseif i == 110 then
insert_item( 3600004, 1 )
elseif i == 115 then
insert_item( 3600004, 1 )
elseif i == 120 then
insert_item( 3600003, 6 )
elseif i == 125 then
insert_item( 3600004, 1 )
elseif i == 130 then
insert_item( 3600004, 1 )
elseif i == 135 then
insert_item( 3600004, 1 )
elseif i == 140 then
insert_item( 3600004, 1 )
elseif i == 145 then
insert_item( 3600004, 1 )
elseif i == 150 then
insert_item( 3600003, 7 )
elseif i == 155 then
insert_item( 3600003, 8 )
elseif i == 160 then
insert_item( 3600003, 9 )
elseif i == 165 then
insert_item( 3600003, 10 )
elseif i == 170 then
insert_item( 3600003, 11 )
elseif i == 175 then
insert_item( 3600003, 12 )
elseif i == 180 then
insert_item( 3600003, 13 )
elseif i == 185 then
insert_item( 3600003, 14 )
elseif i == 190 then
insert_item( 3600003, 25 )
end
end
end
-- ·¹º§¾÷ ½Ã °¡ÀÌµå ¸Þ½ÃÁö Ãâ·Â
on_player_level_joblevel_guide()
end
function on_player_level_joblevel_guide()
--ÀÛ¾÷Áß
local lv = get_value( "level" )
local job_lv = get_value( "job_level" )
local job_dp = get_value( "job_depth" )
if job_dp == 0 and lv >= 10 and job_lv >= 10 then
cprint( "@1200" )
--cprint( "@254" )
cprint( "@1201" )
elseif lv == 20 then
cprint( "@1202" )
cprint( "@1203" )
elseif lv == 50 then
cprint( "@1204" )
cprint( "@1205" )
elseif job_dp== 1 and lv >= 50 and job_lv >= 40 then
cprint( "@1206" )
cprint( "@1207" )
cprint( "@1208" )
elseif lv == 80 then
cprint( "@1209" )
cprint( "@1210" )
elseif lv == 100 then
cprint( "@1211" )
cprint( "@1212" )
end
end
|
|
|
10/25/2011, 07:05
|
#2
|
elite*gold: 0
Join Date: Jul 2009
Posts: 508
Received Thanks: 296
|
Its pretty easy.
Code:
function get_module_name()
return "on_player_level_up"
end
function on_player_level_up()
--local tx, ty, current_x, island_number
local lv = get_value( "level" )
if lv == 5 then
-- °¢ 1¹ø ¼¶ÀÇ ÅÚ·¹Æ÷Æ® ÁÂÇ¥
-- tx = 30315
-- ty = 5480
-- ÇöÀç±Íȯ À§Ä¡¸¦ °¡Á®¿È.
current_x = get_flag( "rx" )
-- ¸î ¹ø ° ¼¶ÀÎÁö È®ÀÎ.
-- local i
-- for i = 1, 6 do
-- if current_x < ( 18816 * (i-1) + tx) and current_x + 3000 > ( (18816 * (i-1) + tx) - 10000) then
-- island_number = i
-- end
-- end
-- ±ÍȯÁö¿ªÀ» ÇöÀç Ãʺ¸ÀÚ¼¶ Ä·ÇÁÀ¸·Î ¼³Á¤
set_flag( "rx", 172543 + math.random(0,100))
set_flag( "ry", 51847 + math.random(0,100))
end
-- ±¹°¡ ÄÚµå Àоî¿À±â
-- get_local_info()ÀÇ ¹Ýȯ°ªµé
--LOCAL_INFO_KOREA = 1
--LOCAL_INFO_HONGKONG = 2
--LOCAL_INFO_AMERICA = 4
--LOCAL_INFO_GERMANY = 8
--LOCAL_INFO_JAPAN = 16
--LOCAL_INFO_TAIWAN = 32
--LOCAL_INFO_CHINA = 64
--LOCAL_INFO_FRANCE = 128
--LOCAL_INFO_RUSSIA = 256
local state_code = get_local_info()
-- 18·¹º§ ÀÌ»óÀ̳ª ¼ö·ÃÀÚÀÇ ¼¶ ³»¿¡ ÀÖ´Â °æ¿ì Á¾Á· ¸¶À»·Î ±Íȯ ÁöÁ¡ ¼³Á¤
local current_x = gv("x")
local current_y = gv("y")
local race = get_value( "race" )
-- ¹Ì±¹ÀÌ¸é ¹«Á¶°Ç ¾Èº¸³¿ (Àü ±¹°¡ Àû¿ë ¾ÈÇÔÀ¸·Î º¯°æ 08.07.29)
if state_code == 511 then
-- ¾Æ¹«Áþµµ ¾ÈÇØ¿ä
elseif lv >= 18 then
-- ¼ö·ÃÀÚÀÇ ¼¶¿¡ ÀÖ´ÂÁö ¿©ºÎ üũ
if current_x >= 161280 and current_x <= 177408 then
if current_y >= 48384 and current_y <= 64512 then
-- ÇöÀç±Íȯ À§Ä¡¸¦ °¡Á®¿È.
local return_x = get_flag( "rx" )
local return_y = get_flag( "ry" )
-- ¼ö·ÃÀÚÀÇ ¼¶ÀÌ ±ÍȯÀÎÁö üũ
if return_x == 173183 and return_y == 52299 then
-- ±ÍȯÁö¿ªÀ» ÇØ´ç Á¾Á· ¸¶À»·Î ¼³Á¤
-- µ¥¹ÙÀÏ °æ¿ì
if race == 4 then
set_flag( "rx", 6625 + math.random(0,100))
set_flag( "ry", 6980 + math.random(0,100))
-- ¾Æ¼ö¶óÀÏ °æ¿ì
elseif race == 5 then
set_flag( "rx", 116799 + math.random(0,100))
set_flag( "ry", 58205 + math.random(0,100))
-- °¡À̾ÆÀÏ °æ¿ì
else
set_flag( "rx", 153513 + math.random(0,100))
set_flag( "ry", 77203 + math.random(0,100))
end -- if race == 4 then
-- ¼ö·ÃÀÚÀÇ ¼¶¿¡ ÀÖ°í 18·¹º§ ÀÌ»óÀ̱⠶§¹®¿¡ ÇØ´ç Á¾Á· ¸¶À»·Î °*Á¦ ±Íȯ ¼³Á¤ µÆ´Ù´Â ¸Þ½ÃÁö ³¯¸².
message( "@235")
end -- if return_x == 173183 and return_y == 52299
end -- if current_y >= 48384 and current_y <= 64512 then
end -- if current_x >= 161280 and current_x <= 177408 then
end -- if lv >= 18 then
-- ¿ÀÅä·Î ¼¼ÆÃµÈ ij¸¯ÅͶó¸é Àú ¸Ö¸® ³¯·Á ¹ö¸®ÀÚ~
kick_auto_to_another_world()
-- ¼ö·ÃÀÚ ¼¶¿¡ ÀÖ´Â ¿ÀÅäµéÀº º»Åä·Î ³¯·Á ¹ö¸®ÀÚ
local current_x = gv("x")
local current_y = gv("y")
local race = get_value( "race" )
if current_x >= 161280 and current_x <= 177408 then
if current_y >= 48384 and current_y <= 64512 then
local is_auto, quest_count
quest_count, is_auto = anti_auto_quest_check()
if is_auto then
if race == 4 then
RunTeleport_Auto_TO_City( 6625 , 6980 )
elseif race == 5 then
RunTeleport_Auto_TO_City( 116799 , 58205 )
else
RunTeleport_Auto_TO_City( 153506 , 77175 )
end
end -- if is_auto then
end -- if current_y >= 48384 and current_y <= 64512 then
end -- if current_x >= 161280 and current_x <= 177408 then
save()
-- ·¹º§¾÷ ´Þ¼º À̺¥Æ® ó¸®
-- ±¹°¡ ÄÚµå Àоî¿À±â
-- get_local_info()ÀÇ ¹Ýȯ°ªµé
--LOCAL_INFO_KOREA = 1
--LOCAL_INFO_HONGKONG = 2
--LOCAL_INFO_AMERICA = 4
--LOCAL_INFO_GERMAN = 8
--LOCAL_INFO_JAPAN = 16
--LOCAL_INFO_TAIWAN = 32
--LOCAL_INFO_CHINA = 64
--LOCAL_INFO_FRANCE = 128
--LOCAL_INFO_RUSSIA = 256
--LOCAL_INFO_MALAYSIA = 512
--LOCAL_INFO_SINGAPORE = 1024
--LOCAL_INFO_VIETNAM = 2048
--LOCAL_INFO_THAILAND = 4096
--LOCAL_INFO_MIDEAST = 8192
--LOCAL_INFO_TURKEY = 16384
local state_code = get_local_info()
if state_code == 8 or state_code == 128 then
local i = get_value( "max_reached_level" )
-------------------------------------------------------------------------
--<<<<<the LUA shows that it search for the "max_reached_level" so dont
--edit the lv functions, because for example: if
--you reach Lv 5 you get the "if i ==4 then" - present >>>>>>>>>>>
-------------------------------------------------------------------------
if i == 4 then
insert_item( 3600004, 1 )
elseif i == 9 then
insert_item( 3600004, 1 )
elseif i == 14 then
insert_item( 3600004, 1 )
elseif i == 19 then
insert_item( 3600003, 2 )
elseif i == 24 then
insert_item( 3600004, 1 )
elseif i == 29 then
insert_item( 3600004, 1 )
elseif i == 34 then
insert_item( 3600004, 1 )
elseif i == 39 then
insert_item( 3600004, 1 )
elseif i == 44 then
insert_item( 3600004, 1 )
elseif i == 49 then
insert_item( 3600003, 3 )
elseif i == 54 then
insert_item( 3600004, 1 )
elseif i == 59 then
insert_item( 3600004, 1 )
elseif i == 64 then
insert_item( 3600004, 1 )
elseif i == 69 then
insert_item( 3600004, 1 )
elseif i == 74 then
insert_item( 3600004, 1 )
elseif i == 79 then
insert_item( 3600003, 4 )
elseif i == 84 then
insert_item( 3600004, 1 )
elseif i == 89 then
insert_item( 3600004, 1 )
elseif i == 94 then
insert_item( 3600004, 1 )
elseif i == 99 then
insert_item( 3600003, 5 )
elseif i == 104 then
insert_item( 3600004, 1 )
elseif i == 109 then
insert_item( 3600004, 1 )
elseif i == 114 then
insert_item( 3600004, 1 )
elseif i == 119 then
insert_item( 3600003, 6 )
elseif i == 124 then
insert_item( 3600004, 1 )
elseif i == 129 then
insert_item( 3600004, 1 )
elseif i == 134 then
insert_item( 3600004, 1 )
elseif i == 139 then
insert_item( 3600004, 1 )
elseif i == 144 then
insert_item( 3600004, 1 )
elseif i == 149 then
insert_item( 3600003, 7 )
elseif i == 154 then
insert_item( 3600003, 8 )
elseif i == 159 then
insert_item( 3600003, 9 )
elseif i == 164 then
insert_item( 3600003, 10 )
elseif i == 169 then
insert_item( 3600003, 11 )
elseif i == 174 then
insert_item( 3600003, 12 )
elseif i == 179 then
insert_item( 3600003, 13 )
elseif i == 184 then
insert_item( 3600003, 14 )
elseif i == 189 then
insert_item( 3600003, 25 )
end
end
end
-- ·¹º§¾÷ ½Ã °¡ÀÌµå ¸Þ½ÃÁö Ãâ·Â
on_player_level_joblevel_guide()
end
function on_player_level_joblevel_guide()
--ÀÛ¾÷Áß
local lv = get_value( "level" )
local job_lv = get_value( "job_level" )
local job_dp = get_value( "job_depth" )
if job_dp == 0 and lv >= 10 and job_lv >= 10 then
cprint( "@1200" )
--cprint( "@254" )
cprint( "@1201" )
elseif lv == 20 then
cprint( "@1202" )
cprint( "@1203" )
elseif lv == 50 then
cprint( "@1204" )
cprint( "@1205" )
elseif job_dp== 1 and lv >= 50 and job_lv >= 40 then
cprint( "@1206" )
cprint( "@1207" )
cprint( "@1208" )
elseif lv == 80 then
cprint( "@1209" )
cprint( "@1210" )
elseif lv == 100 then
cprint( "@1211" )
cprint( "@1212" )
end
end
|
|
|
10/25/2011, 13:56
|
#3
|
elite*gold: 0
Join Date: Jun 2008
Posts: 86
Received Thanks: 1
|
I have tried using your code and when I hit level 5 on a toon I get a string problem with the lua.
|
|
|
10/25/2011, 15:18
|
#4
|
elite*gold: 0
Join Date: Oct 2010
Posts: 2,555
Received Thanks: 2,460
|
Remove the modifications that you have made to your on_level.lua and open a new text document via InType or Notepad w/e you use.
Paste the following into the new text file:
Code:
function get_module_name()
return "on_level_prize"
end
function on_level_prize() -- This is the name of the function which we will call from our On_Login, On_Level and/or On_Death
lv = gv( "level" ) -- This defines LV as the value retrieved from the "lv" column in the database.
if lv > 4 and lv < 6 then -- this defines a range between 4 and 6 which is 5.
insert_item(item id) -- This is where the actual level 5 prize is inserted if the player is level 5.
cprint("You have received a level up prize.") -- This is a message sent to the players chat screen.
elseif lv > 9 and lv < 11 then -- this defines a range between 9 and 11 which is 10.
insert_item(item id) -- This is where the actual level 5 prize is inserted if the player is level 10.
cprint("You have received a level up prize.") -- This is a message sent to the players chat screen.
elseif lv > 19 and lv < 21 then -- this defines a range between 19 and 21 which is 20.
insert_item(item id) -- This is where the actual level 5 prize is inserted if the player is level 20.
cprint("You have received a level up prize.") -- This is a message sent to the players chat screen.
elseif lv > 29 and lv < 31 then -- this defines a range between 29 and 31 which is 30.
insert_item(item id) -- This is where the actual level 5 prize is inserted if the player is level 30.
cprint("You have received a level up prize.") -- This is a message sent to the players chat screen.
end
end
That is an example of a set of triggers that work on a primary if and following elseif, that will disperse prizes based on level. You will need to add a call function to the desired lua's: (on_login, on_level, on_death) the name of the call trigger must be exactly the name of the function we pasted above: ( on_level_prize() <-- IMPORTANT: The brackets '()' must be included at the end of the call function name.)
An example of a call function is as follows:
on_player_level.lua example:
Code:
if is_auto then
if race == 4 then
RunTeleport_Auto_TO_City( 6625 , 6980 )
elseif race == 5 then
RunTeleport_Auto_TO_City( 116799 , 58205 )
else
RunTeleport_Auto_TO_City( 153506 , 77175 )
end
end -- if is_auto then
end -- if current_y >= 48384 and current_y <= 64512 then
end -- if current_x >= 161280 and current_x <= 177408 then
save()
-- ·¹º§¾÷ ´Þ¼º À̺¥Æ® ó¸®
-- ±¹°¡ ÄÚµå Àоî¿À±â
-- get_local_info()ÀÇ ¹Ýȯ°ªµé
--LOCAL_INFO_KOREA = 1
--LOCAL_INFO_HONGKONG = 2
--LOCAL_INFO_AMERICA = 4
--LOCAL_INFO_GERMAN = 8
--LOCAL_INFO_JAPAN = 16
--LOCAL_INFO_TAIWAN = 32
--LOCAL_INFO_CHINA = 64
--LOCAL_INFO_FRANCE = 128
--LOCAL_INFO_RUSSIA = 256
--LOCAL_INFO_MALAYSIA = 512
--LOCAL_INFO_SINGAPORE = 1024
--LOCAL_INFO_VIETNAM = 2048
--LOCAL_INFO_THAILAND = 4096
--LOCAL_INFO_MIDEAST = 8192
--LOCAL_INFO_TURKEY = 16384
--============================================================
-- <<<<<< [ABR] Auto Buff Remove: Start >>>>>>
--============================================================
permanentserverbuff_remove()
temporaryserverbuff_remove()
hv_pass_remove()
buff_under_20_remove()
buff_above_20_remove()
buff_above_50_remove()
buff_above_80_remove()
buff_above_100_remove()
buff_above_120_remove()
buff_above_150_remove()
buff_above_160_remove()
buff_at_170_remove()
buff_pet_below_100_remove()
buff_pet_above_100_remove()
permanentserverbuff_give()
temporaryserverbuff_give()
--============================================================
-- <<<<<< Auto Buff Remove: End >>>>>>
--============================================================
--============================================================
-- <<<<<< [ABG] Auto Buff Give: Start >>>>>>
--============================================================
hv_pass_give()
hv_ticket_give()
buff_under_20_give()
buff_above_20_give()
buff_above_50_give()
buff_above_80_give()
buff_above_100_give()
buff_above_120_give()
buff_above_150_give()
buff_above_160_give()
buff_at_170_give()
--============================================================
-- <<<<<< Auto Buff Give: End >>>>>>
--============================================================
--============================================================
-- <<<<<< Auto Buff 150-160 Set Effect: Start >>>>>>
--============================================================
--Original Credits to: MisterD and gr4ph0s
--Alteration Credits to: iSmokeDrow
--150 Set Bonus
trigger_effect_150_1()
trigger_effect_150_2()
trigger_effect_150_3()
trigger_effect_150_4()
--155 Set Bonus
trigger_effect_155_1()
trigger_effect_155_2()
trigger_effect_155_3()
trigger_effect_155_4()
--160 Set Bonus
trigger_effect_160_1()
trigger_effect_160_2()
trigger_effect_160_3()
trigger_effect_160_4()
--============================================================
-- <<<<<< Auto Buff 150-160 Set Effect: End >>>>>>
--============================================================
--============================================================
-- <<<<<< On_Login XP to GP Start >>>>>>
--============================================================
convert_xp_to_gen_point_lv5()
convert_xp_to_gen_point_lv10()
convert_xp_to_gen_point_lv15()
convert_xp_to_gen_point_lv20()
convert_xp_to_gen_point_lv25()
convert_xp_to_gen_point_lv30()
convert_xp_to_gen_point_lv40()
convert_xp_to_gen_point_lv60()
convert_xp_to_gen_point_lv80()
convert_xp_to_gen_point_lv100()
convert_xp_to_gen_point_lv120()
convert_xp_to_gen_point_lv140()
convert_xp_to_gen_point_lv150()
convert_xp_to_gen_point_lv155()
convert_xp_to_gen_point_lv160()
--============================================================
-- <<<<<< On_Login XP to GP END >>>>>>
--============================================================
local state_code = get_local_info()
|
|
|
10/25/2011, 15:46
|
#5
|
elite*gold: 0
Join Date: Jul 2009
Posts: 508
Received Thanks: 296
|
Quote:
Originally Posted by ismokedrow
Remove the modifications that you have made to your on_level.lua and open a new text document via InType or Notepad w/e you use.
Paste the following into the new text file:
Code:
function get_module_name()
return "on_level_prize"
end
function on_level_prize() -- This is the name of the function which we will call from our On_Login, On_Level and/or On_Death
lv = gv( "level" ) -- This defines LV as the value retrieved from the "lv" column in the database.
if lv > 4 and lv < 6 then -- this defines a range between 4 and 6 which is 5.
insert_item(item id) -- This is where the actual level 5 prize is inserted if the player is level 5.
cprint("You have received a level up prize.") -- This is a message sent to the players chat screen.
elseif lv > 9 and lv < 11 then -- this defines a range between 9 and 11 which is 10.
insert_item(item id) -- This is where the actual level 5 prize is inserted if the player is level 10.
cprint("You have received a level up prize.") -- This is a message sent to the players chat screen.
elseif lv > 19 and lv < 21 then -- this defines a range between 19 and 21 which is 20.
insert_item(item id) -- This is where the actual level 5 prize is inserted if the player is level 20.
cprint("You have received a level up prize.") -- This is a message sent to the players chat screen.
elseif lv > 29 and lv < 31 then -- this defines a range between 29 and 31 which is 30.
insert_item(item id) -- This is where the actual level 5 prize is inserted if the player is level 30.
cprint("You have received a level up prize.") -- This is a message sent to the players chat screen.
end
end
That is an example of a set of triggers that work on a primary if and following elseif, that will disperse prizes based on level. You will need to add a call function to the desired lua's: (on_login, on_level, on_death) the name of the call trigger must be exactly the name of the function we pasted above: ( on_level_prize() <-- IMPORTANT: The brackets '()' must be included at the end of the call function name.)
An example of a call function is as follows:
on_player_level.lua example:
Code:
if is_auto then
if race == 4 then
RunTeleport_Auto_TO_City( 6625 , 6980 )
elseif race == 5 then
RunTeleport_Auto_TO_City( 116799 , 58205 )
else
RunTeleport_Auto_TO_City( 153506 , 77175 )
end
end -- if is_auto then
end -- if current_y >= 48384 and current_y <= 64512 then
end -- if current_x >= 161280 and current_x <= 177408 then
save()
-- ·¹º§¾÷ ´Þ¼º À̺¥Æ® ó¸®
-- ±¹°¡ ÄÚµå Àоî¿À±â
-- get_local_info()ÀÇ ¹Ýȯ°ªµé
--LOCAL_INFO_KOREA = 1
--LOCAL_INFO_HONGKONG = 2
--LOCAL_INFO_AMERICA = 4
--LOCAL_INFO_GERMAN = 8
--LOCAL_INFO_JAPAN = 16
--LOCAL_INFO_TAIWAN = 32
--LOCAL_INFO_CHINA = 64
--LOCAL_INFO_FRANCE = 128
--LOCAL_INFO_RUSSIA = 256
--LOCAL_INFO_MALAYSIA = 512
--LOCAL_INFO_SINGAPORE = 1024
--LOCAL_INFO_VIETNAM = 2048
--LOCAL_INFO_THAILAND = 4096
--LOCAL_INFO_MIDEAST = 8192
--LOCAL_INFO_TURKEY = 16384
--============================================================
-- <<<<<< [ABR] Auto Buff Remove: Start >>>>>>
--============================================================
permanentserverbuff_remove()
temporaryserverbuff_remove()
hv_pass_remove()
buff_under_20_remove()
buff_above_20_remove()
buff_above_50_remove()
buff_above_80_remove()
buff_above_100_remove()
buff_above_120_remove()
buff_above_150_remove()
buff_above_160_remove()
buff_at_170_remove()
buff_pet_below_100_remove()
buff_pet_above_100_remove()
permanentserverbuff_give()
temporaryserverbuff_give()
--============================================================
-- <<<<<< Auto Buff Remove: End >>>>>>
--============================================================
--============================================================
-- <<<<<< [ABG] Auto Buff Give: Start >>>>>>
--============================================================
hv_pass_give()
hv_ticket_give()
buff_under_20_give()
buff_above_20_give()
buff_above_50_give()
buff_above_80_give()
buff_above_100_give()
buff_above_120_give()
buff_above_150_give()
buff_above_160_give()
buff_at_170_give()
--============================================================
-- <<<<<< Auto Buff Give: End >>>>>>
--============================================================
--============================================================
-- <<<<<< Auto Buff 150-160 Set Effect: Start >>>>>>
--============================================================
--Original Credits to: MisterD and gr4ph0s
--Alteration Credits to: iSmokeDrow
--150 Set Bonus
trigger_effect_150_1()
trigger_effect_150_2()
trigger_effect_150_3()
trigger_effect_150_4()
--155 Set Bonus
trigger_effect_155_1()
trigger_effect_155_2()
trigger_effect_155_3()
trigger_effect_155_4()
--160 Set Bonus
trigger_effect_160_1()
trigger_effect_160_2()
trigger_effect_160_3()
trigger_effect_160_4()
--============================================================
-- <<<<<< Auto Buff 150-160 Set Effect: End >>>>>>
--============================================================
--============================================================
-- <<<<<< On_Login XP to GP Start >>>>>>
--============================================================
convert_xp_to_gen_point_lv5()
convert_xp_to_gen_point_lv10()
convert_xp_to_gen_point_lv15()
convert_xp_to_gen_point_lv20()
convert_xp_to_gen_point_lv25()
convert_xp_to_gen_point_lv30()
convert_xp_to_gen_point_lv40()
convert_xp_to_gen_point_lv60()
convert_xp_to_gen_point_lv80()
convert_xp_to_gen_point_lv100()
convert_xp_to_gen_point_lv120()
convert_xp_to_gen_point_lv140()
convert_xp_to_gen_point_lv150()
convert_xp_to_gen_point_lv155()
convert_xp_to_gen_point_lv160()
--============================================================
-- <<<<<< On_Login XP to GP END >>>>>>
--============================================================
local state_code = get_local_info()
|
The problem with the lv up insert item is, some player uses a failure in this.
for example you hittet lvl 120 - get the item, than you go die and use a god mother fairy bottle and hit 120 again and will recieve the item again
To stop this just set the target on the "max_reached_level"
Than you cant recieve double items
This is the LUA, im using for my Server
Code:
function get_module_name()
return "on_player_level_up"
end
function on_player_level_up()
--local tx, ty, current_x, island_number
local lv = get_value( "level" )
if lv == 5 then
-- °¢ 1¹ø ¼¶ÀÇ ÅÚ·¹Æ÷Æ® ÁÂÇ¥
-- tx = 30315
-- ty = 5480
-- ÇöÀç±Íȯ À§Ä¡¸¦ °¡Á®¿È.
current_x = get_flag( "rx" )
-- ¸î ¹ø ° ¼¶ÀÎÁö È®ÀÎ.
-- local i
-- for i = 1, 6 do
-- if current_x < ( 18816 * (i-1) + tx) and current_x + 3000 > ( (18816 * (i-1) + tx) - 10000) then
-- island_number = i
-- end
-- end
-- ±ÍȯÁö¿ªÀ» ÇöÀç Ãʺ¸ÀÚ¼¶ Ä·ÇÁÀ¸·Î ¼³Á¤
set_flag( "rx", 172543 + math.random(0,100))
set_flag( "ry", 51847 + math.random(0,100))
end
-- ±¹°¡ ÄÚµå Àоî¿À±â
-- get_local_info()ÀÇ ¹Ýȯ°ªµé
--LOCAL_INFO_KOREA = 1
--LOCAL_INFO_HONGKONG = 2
--LOCAL_INFO_AMERICA = 4
--LOCAL_INFO_GERMANY = 8
--LOCAL_INFO_JAPAN = 16
--LOCAL_INFO_TAIWAN = 32
--LOCAL_INFO_CHINA = 64
--LOCAL_INFO_FRANCE = 128
--LOCAL_INFO_RUSSIA = 256
local state_code = get_local_info()
-- 18·¹º§ ÀÌ»óÀ̳ª ¼ö·ÃÀÚÀÇ ¼¶ ³»¿¡ ÀÖ´Â °æ¿ì Á¾Á· ¸¶À»·Î ±Íȯ ÁöÁ¡ ¼³Á¤
local current_x = gv("x")
local current_y = gv("y")
local race = get_value( "race" )
-- ¹Ì±¹ÀÌ¸é ¹«Á¶°Ç ¾Èº¸³¿ (Àü ±¹°¡ Àû¿ë ¾ÈÇÔÀ¸·Î º¯°æ 08.07.29)
if state_code == 511 then
-- ¾Æ¹«Áþµµ ¾ÈÇØ¿ä
elseif lv >= 18 then
-- ¼ö·ÃÀÚÀÇ ¼¶¿¡ ÀÖ´ÂÁö ¿©ºÎ üũ
if current_x >= 161280 and current_x <= 177408 then
if current_y >= 48384 and current_y <= 64512 then
-- ÇöÀç±Íȯ À§Ä¡¸¦ °¡Á®¿È.
local return_x = get_flag( "rx" )
local return_y = get_flag( "ry" )
-- ¼ö·ÃÀÚÀÇ ¼¶ÀÌ ±ÍȯÀÎÁö üũ
if return_x == 173183 and return_y == 52299 then
-- ±ÍȯÁö¿ªÀ» ÇØ´ç Á¾Á· ¸¶À»·Î ¼³Á¤
-- µ¥¹ÙÀÏ °æ¿ì
if race == 4 then
set_flag( "rx", 6625 + math.random(0,100))
set_flag( "ry", 6980 + math.random(0,100))
-- ¾Æ¼ö¶óÀÏ °æ¿ì
elseif race == 5 then
set_flag( "rx", 116799 + math.random(0,100))
set_flag( "ry", 58205 + math.random(0,100))
-- °¡À̾ÆÀÏ °æ¿ì
else
set_flag( "rx", 153513 + math.random(0,100))
set_flag( "ry", 77203 + math.random(0,100))
end -- if race == 4 then
-- ¼ö·ÃÀÚÀÇ ¼¶¿¡ ÀÖ°í 18·¹º§ ÀÌ»óÀ̱⠶§¹®¿¡ ÇØ´ç Á¾Á· ¸¶À»·Î °*Á¦ ±Íȯ ¼³Á¤ µÆ´Ù´Â ¸Þ½ÃÁö ³¯¸².
message( "@235")
end -- if return_x == 173183 and return_y == 52299
end -- if current_y >= 48384 and current_y <= 64512 then
end -- if current_x >= 161280 and current_x <= 177408 then
end -- if lv >= 18 then
-- ¿ÀÅä·Î ¼¼ÆÃµÈ ij¸¯ÅͶó¸é Àú ¸Ö¸® ³¯·Á ¹ö¸®ÀÚ~
kick_auto_to_another_world()
-- ¼ö·ÃÀÚ ¼¶¿¡ ÀÖ´Â ¿ÀÅäµéÀº º»Åä·Î ³¯·Á ¹ö¸®ÀÚ
local current_x = gv("x")
local current_y = gv("y")
local race = get_value( "race" )
if current_x >= 161280 and current_x <= 177408 then
if current_y >= 48384 and current_y <= 64512 then
local is_auto, quest_count
quest_count, is_auto = anti_auto_quest_check()
if is_auto then
if race == 4 then
RunTeleport_Auto_TO_City( 6625 , 6980 )
elseif race == 5 then
RunTeleport_Auto_TO_City( 116799 , 58205 )
else
RunTeleport_Auto_TO_City( 153506 , 77175 )
end
end -- if is_auto then
end -- if current_y >= 48384 and current_y <= 64512 then
end -- if current_x >= 161280 and current_x <= 177408 then
save()
-- ·¹º§¾÷ ´Þ¼º À̺¥Æ® ó¸®
-- ±¹°¡ ÄÚµå Àоî¿À±â
-- get_local_info()ÀÇ ¹Ýȯ°ªµé
--LOCAL_INFO_KOREA = 1
--LOCAL_INFO_HONGKONG = 2
--LOCAL_INFO_AMERICA = 4
--LOCAL_INFO_GERMAN = 8
--LOCAL_INFO_JAPAN = 16
--LOCAL_INFO_TAIWAN = 32
--LOCAL_INFO_CHINA = 64
--LOCAL_INFO_FRANCE = 128
--LOCAL_INFO_RUSSIA = 256
--LOCAL_INFO_MALAYSIA = 512
--LOCAL_INFO_SINGAPORE = 1024
--LOCAL_INFO_VIETNAM = 2048
--LOCAL_INFO_THAILAND = 4096
--LOCAL_INFO_MIDEAST = 8192
--LOCAL_INFO_TURKEY = 16384
local state_code = get_local_info()
local i = get_value( "max_reached_level" )
if i == 4 then
elseif i == 9 then
insert_gold( 1000000 )
warp( 184475 , 138327 )
elseif i == 14 then
insert_item( 3600289, 1 )
elseif i == 19 then
insert_item( 3600289, 1 )
insert_item( 3600006,1,0,0,2) -- lvl 20 box
elseif i == 24 then
insert_item( 691112, 1 )
insert_item( 691121, 1 )
insert_item( 3600289, 1 )
elseif i == 29 then
insert_item( 3600289, 1 )
elseif i == 34 then
elseif i == 39 then
elseif i == 44 then
elseif i == 49 then
insert_item( 3600289, 1 )
insert_item( 3600007,1,0,0,2) -- lvl 50 box
elseif i == 54 then
insert_item( 2000325, 1 )
elseif i == 59 then
insert_item( 3600289, 1 )
elseif i == 64 then
elseif i == 69 then
insert_item( 3600289, 1 )
elseif i == 74 then
elseif i == 79 then
insert_item( 691126, 1 )
insert_item( 691115, 1 )
insert_item( 3600289, 1 )
insert_item( 3600008,1,0,0,2) -- lvl 80 box
elseif i == 84 then
elseif i == 89 then
elseif i == 94 then
elseif i == 99 then
insert_item( 2010947, 1 )
insert_item( 3600289, 1 )
insert_item( 3600009,1,0,0,2) -- lvl 100 box
elseif i == 104 then
elseif i == 109 then
insert_item( 3600289, 1 )
elseif i == 114 then
insert_item( 3600289, 1 )
elseif i == 119 then
insert_item( 3600289, 1 )
insert_item( 2010900,1,0,0,2 ) -- golden monarch box
elseif i == 124 then
insert_item( 3600289, 1 )
elseif i == 129 then
insert_item( 2010946, 1 )
insert_item( 3600289, 1 )
elseif i == 134 then
insert_item( 3600289, 1 )
elseif i == 139 then
insert_item( 3600289, 1 )
elseif i == 144 then
insert_item( 3600289, 1 )
elseif i == 149 then
notice'A new Player reached Lv 150, GZ!'
insert_item( 3600289, 1 )
insert_item( 3600289, 1 )
insert_item( 2010676,1,0,0,2 ) -- lvl 150 box
insert_item( 2010676,1,0,0,2 ) -- lvl 150 box
elseif i == 154 then
notice'A new Player reached Lv 155, GZ!'
insert_item( 3600289, 1 )
insert_item( 3600289, 1 )
insert_item( 960019,1,0,0,2 ) -- KSP
insert_item( 960019,1,0,0,2 ) -- KSP
insert_item( 960019,1,0,0,2 ) -- KSP
insert_item( 960019,1,0,0,2 ) -- KSP
insert_item( 960019,1,0,0,2 ) -- KSP
elseif i == 159 then
notice'A new Player reached Lv 160, GZ!'
insert_item( 540071, 1 )
insert_item( 3600289, 1 )
insert_item( 3600289, 1 )
elseif i == 164 then
notice'A new Player reached Lv 165, GZ!'
insert_item( 3600289, 1 )
insert_item( 3600289, 1 )
insert_item( 3600289, 1 )
insert_item( 3600289, 1 )
insert_item( 3600289, 1 )
elseif i == 169 then
notice'A new Player reached Lv 170, GZ!'
insert_item( 3600289, 1 )
insert_item( 3600289, 1 )
insert_item( 3600289, 1 )
insert_item( 3600289, 1 )
insert_item( 3600289, 1 )
insert_item( 540073, 1 )
end
-- ·¹º§¾÷ ½Ã °¡ÀÌµå ¸Þ½ÃÁö Ãâ·Â
on_player_level_joblevel_guide()
end
function on_player_level_joblevel_guide()
--ÀÛ¾÷Áß
local lv = get_value( "level" )
local job_lv = get_value( "job_level" )
local job_dp = get_value( "job_depth" )
if job_dp == 0 and lv >= 10 and job_lv >= 10 then
cprint( "@1200" )
--cprint( "@254" )
cprint( "@1201" )
elseif lv == 20 then
cprint( "@1202" )
cprint( "@1203" )
elseif lv == 50 then
cprint( "@1204" )
cprint( "@1205" )
elseif job_dp== 1 and lv >= 50 and job_lv >= 40 then
cprint( "@1206" )
cprint( "@1207" )
cprint( "@1208" )
elseif lv == 80 then
cprint( "@1209" )
cprint( "@1210" )
elseif lv == 100 then
cprint( "@1211" )
cprint( "@1212" )
end
end
|
|
|
All times are GMT +1. The time now is 18:17.
|
|