event_easter_2013={["start"]=0,spawn_metin= function (map_index)local settings = event_easter_2013 . get_settings ( ) 
local level_table = settings . spawn . maps [ map_index ] 
if level_table == nil then 
return 
end 
table . foreach ( level_table , 
function ( index , level ) 
for i = 0 , 5 begin 
regen_in_map ( map_index , "locale/_master/map/easter/metin_regen_level" .. level .. ".txt" ) 
end 
end 
) 
mob . spawn ( 20352 , 1 , 1 , 1 , 1 , 1 ) 
end ,metin_killed= function (vnum)local settings = event_easter_2013 . get_settings ( ) 
local level = settings . metins [ vnum ] 
regen_in_map ( pc . get_map_index ( ) , "locale/_master/map/easter/metin_regen_level" .. level .. ".txt" ) 
if level < pc . get_level ( ) - settings . max_level_difference then 
return 
else 
local eggVnum = math . random ( 50160 , 50179 ) 
game . drop_item_with_ownership ( eggVnum , 1 ) 
if math . random ( 1 , 100 ) <= settings . magicegg . pct then 
game . drop_item_with_ownership ( settings . magicegg . vnum , 1 ) 
end 
end 
end ,is_running= function ()return ( game . get_event_flag ( "easter_drop" ) > 0 ) 
end ,has_rabbit= function ()return ( game . get_event_flag ( "easter_rabbit" ) > 0 ) 
end ,get_settings= function ()local spawnPromille = game . get_event_flag ( "easter_spawn_chance" ) 
if spawnPromille <= 0 then 
spawnPromille = 5 
end 
local magicEggPercent = game . get_event_flag ( "easter_magicegg_chance" ) 
if magicEggPercent <= 0 then 
magicEggPercent = 5 
end 
return { 
[ "eggvnums" ] = { 
[ "first" ] = 50160 , 
[ "last" ] = 50179 , 
} , 
[ "baskets" ] = { 
[ "full" ] = 50181 , 
[ "empty" ] = 50180 , 
} , 
[ "magicegg" ] = { 
[ "vnum" ] = 71150 , 
[ "pct" ] = magicEggPercent , 
} , 
[ "metins" ] = { 
[ 8041 ] = 10 , 
[ 8042 ] = 20 , 
[ 8043 ] = 30 , 
[ 8044 ] = 40 , 
[ 8045 ] = 50 , 
[ 8046 ] = 60 , 
[ 8047 ] = 70 , 
[ 8048 ] = 80 , 
[ 8049 ] = 90 , 
[ 8050 ] = 95 
} , 
[ "max_level_difference" ] = 15 , 
[ "rabbit" ] = 30129 , 
[ "spawn" ] = { 
[ "kill" ] = 100 , 
[ "cooldown" ] = 60 , 
[ "promille" ] = spawnPromille , 
[ "maps" ] = { 
[ 1 ] = { 10 , 20 } , 
[ 3 ] = { 20 , 30 } , 
[ 21 ] = { 10 , 20 } , 
[ 23 ] = { 20 , 30 } , 
[ 41 ] = { 10 , 20 } , 
[ 43 ] = { 20 , 30 } , 
[ 61 ] = { 50 , 60 } , 
[ 62 ] = { 50 , 60 } , 
[ 63 ] = { 40 , 50 } , 
[ 64 ] = { 30 , 40 } , 
[ 65 ] = { 40 , 50 } , 
[ 67 ] = { 60 , 70 } , 
[ 68 ] = { 70 , 80 } , 
[ 69 ] = { 60 , 70 } , 
[ 70 ] = { 70 , 80 } , 
[ 301 ] = { 90 , 95 } , 
[ 302 ] = { 90 , 95 } , 
[ 303 ] = { 90 , 95 } , 
[ 304 ] = { 90 , 95 } , 
} , 
} , 
} 
end ,get_reward_table_for_item= function ()local playerlevel = pc . get_level ( ) 
if playerlevel <= 18 then 
return { 
{ 27002 , 13 } , 
{ 27005 , 13 } , 
{ 27100 , 8 } , 
{ 27103 , 8 } , 
{ 50721 , 4 } , 
{ 30053 , 9 , 20 } , 
{ 30073 , 9 , 20 } , 
{ 30033 , 9 , 20 } , 
{ 30010 , 9 , 20 } , 
{ 30031 , 9 , 20 } , 
{ 30032 , 9 , 20 } 
} 
elseif playerlevel > 18 and playerlevel <= 30 then 
return { 
{ 27002 , 18 } , 
{ 27005 , 18 } , 
{ 27100 , 7 } , 
{ 27103 , 7 } , 
{ 27101 , 3 } , 
{ 27104 , 3 } , 
{ 50721 , 8 } , 
{ 50722 , 8 } , 
{ 50723 , 8 } , 
{ 50724 , 8 } , 
{ 50300 , 2 , 20 } , 
{ 30196 , 5 , 20 } , 
{ 30090 , 5 , 20 } 
} 
elseif playerlevel > 30 and playerlevel <= 52 then 
return { 
{ 27101 , 8 } , 
{ 27104 , 8 } , 
{ 27003 , 17 } , 
{ 27006 , 17 } , 
{ 27102 , 3 } , 
{ 27105 , 3 } , 
{ 50721 , 5 } , 
{ 50722 , 5 } , 
{ 50723 , 5 } , 
{ 50724 , 5 } , 
{ 50725 , 5 } , 
{ 50726 , 5 } , 
{ 50727 , 5 } , 
{ 50728 , 5 } , 
{ 50300 , 1 , 20 } , 
{ 30195 , 4 , 20 } , 
{ 30197 , 4 , 20 } , 
{ 30193 , 3 , 20 } 
} 
elseif playerlevel > 52 and playerlevel <= 74 then 
return { 
{ 27003 , 14 } , 
{ 27006 , 14 } , 
{ 27102 , 9 } , 
{ 27105 , 9 } , 
{ 50721 , 5 } , 
{ 50722 , 5 } , 
{ 50723 , 5 } , 
{ 50724 , 5 } , 
{ 50725 , 5 } , 
{ 50726 , 5 } , 
{ 50727 , 5 } , 
{ 50728 , 5 } , 
{ 50300 , 1 , 20 } , 
{ 30198 , 4 , 20 } , 
{ 30199 , 4 , 20 } , 
{ 8005 , 3 } , 
} 
else 
return { 
{ 27102 , 11 } , 
{ 27105 , 11 } , 
{ 50091 , 15 } , 
{ 50092 , 15 } , 
{ 50093 , 15 } , 
{ 50094 , 15 } , 
{ 50300 , 4 , 20 } , 
{ 50060 , 6 , 20 } , 
{ 8005 , 4 } , 
{ 30196 , 2 , 20 } , 
{ 30090 , 2 , 20 } , 
{ 30195 , 2 , 20 } , 
{ 30197 , 2 , 20 } , 
{ 30198 , 2 , 20 } , 
{ 30199 , 2 , 20 } 
} 
end 
end ,get_reward_amount_for_vnum= function (reward_table,vnum_to_search)local amount_needed = 1 
table . foreachi ( reward_table , 
function ( index , item ) 
local itemVnum = item [ 1 ] 
if itemVnum == vnum_to_search then 
if table . getn ( item ) > 2 then 
amount_needed = item [ 3 ] 
else 
amount_needed = 1 
end 
return 
end 
end 
) 
return amount_needed 
end ,get_number_of_eggs= function ()local settings = event_easter_2013 . get_settings ( ) 
return count_item_range ( settings . eggvnums . first , settings . eggvnums . last ) 
end ,get_random_reward_vnum= function (reward_table)local temp_table = { } 
local easterEggCount = event_easter_2013 . get_number_of_eggs ( ) 
table . foreachi ( reward_table , 
function ( index , item ) 
local itemProbability = item [ 2 ] 
local itemVnum = item [ 1 ] 
local meetsAmountLimit = true 
if table . getn ( item ) > 2 then 
if easterEggCount < item [ 3 ] then 
meetsAmountLimit = false 
end 
end 
if meetsAmountLimit then 
for amount = 1 , itemProbability begin 
table . insert ( temp_table , itemVnum ) 
end 
end 
end 
) 
return temp_table [ math . random ( table . getn ( temp_table ) ) ] 
end }