Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Basic Tree Planting - ( Finished )

Newbie Spellweaver
Joined
Jul 4, 2010
Messages
8
Reaction score
0
Im not a professional scripter so it will not be to fancy, but at the moment, im working on some scripts that'll be linked to seeds and upon double clicking them, a tree will be spawned based on the seed you use, and can be cut for logs.
It's not something I would expect to see in higher up servers; however, the idea is cool and would be really nice to see done by a professional. Anyways, update on my progress will be posted beneath. I'll upload the Items + scripts after I finish.

----------------
----Legend----
----------------
Working
Not Working/Untested
--------------
Progress:
--------------
Pine Tree - Pine Seed
Iron Tree - Iron Seed
Tree of Fortune - Fortune Seed
Mystic Tree - Mystic Seed
Legendary Tree of Fortune - (L) Fortune Seed
Defoliate Pine - Defoliate Seed
Lavender Core Wood - Lavender Seed
Tusk Softwood - Tusk Seed
Metal Norite - Norite Seed
Rue - Rue Seed
Flower Pear - Pear Seed
Fir - Fir Seed
Jade Sandal - Jade Seed
Crimson Ceiba - Crimson Seed
Water Willow - Willow Seed

:thumbup: Code below for any "Virus" accusers.
Add the scripts to the "ItemEffect.lua" file.
(ServerRootDirectory\resource\script\calculate)
and
simply add the actual items to the Iteminfo.txt
(ServerRootDirectory\resource\iteminfo.txt)


Code:
//////////////////////////////////////////////////////////////////////////
//////////////////The Seeds///////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
7918	Pine Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantpine	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Pine Tree seed.	0																																																																																													
7919	Mystic Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantmystic	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Mystic Tree seed.	0																																																																																													
7920	Fortune Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantfortune	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Fortune Tree seed.	0																																																																																													
7921	Iron Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantiron	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Iron Tree seed.	0																																																																																													
7922	Legendary Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantlegendtree	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Legendary Fortune Tree seed.	0																																																																																													
7923	Defoliate Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantDefoliate	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Defoliate Tree seed.	0																																																																																													
7924	Lavender Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantLavender	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Defoliate Tree seed.	0																																																																																													
7925	Tusk Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_planttusk	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Tusk Tree seed.	0																																																																																													
7926	Norite Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantnorite	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Norite Tree seed.	0																																																																																													
7927	Rue Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantrue	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Rue Tree seed.	0																																																																																													
7928	Pear Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantpear	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Pear Tree seed.	0																																																																																													
7929	Fir Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantfir	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Fir Tree seed.	0																																																																																													
7930	Jade Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantJade	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Jade Tree seed.	0																																																																																													
7931	Crimson Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantcrimson	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Crimson Tree seed.	0																																																																																													
7932	Willow Seed	n0538	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	0	1	99	1	1500	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_plantwillow	0	0	0	0,0	0,0	0,0	A seed which seems to be extremely fertile. This could grow at an extremely rapid rate if planted outside. It appears to be a Willow Tree seed.	0																																																																																													
//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////The Scripts//////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

function ItemUse_plantpine (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 207
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end

function ItemUse_plantmystic (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 699
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end

function ItemUse_plantfortune (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 718
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end

function ItemUse_plantiron (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 746
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end

function ItemUse_plantlegendtree (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 778
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end

function ItemUse_plantDefoliate (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 888
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end

function ItemUse_plantLavender (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 889
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end


function ItemUse_planttusk (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 890
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end


function ItemUse_plantnorite (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 891
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end


function ItemUse_plantrue (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 892
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end

function ItemUse_plantpear (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 893
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end


function ItemUse_plantfir (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 894
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end


function ItemUse_plantJade (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 895
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end



function ItemUse_plantcrimson (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 896
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end



function ItemUse_plantwillow (role , Item)
local Cha_Boat = 0
      Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use while sailing" )
		UseItemFailed ( role )
		return
	end
	local reg = 0
	      reg =IsChaInRegion( role, 2 )
	if reg == 1 then
		SystemNotice( role , "The soil here seems terrible. There has got to be a better more nutrient rich source." )
		UseItemFailed ( role )
                return

	end
		local TimeRange = 30
		local x, y = GetChaPos(role)
		local MonsterID = 897
                local Refresh = 1900000				        
		local life = 1800000						
		local new = CreateChaX( MonsterID , x , y , 145 , Refresh,role )
		SetChaLifeTime( new, life )
end
 

Attachments

You must be registered for see attachments list
Last edited:
Junior Spellweaver
Joined
Oct 16, 2008
Messages
197
Reaction score
1
----------------
----Legend----
----------------
Working
Not Working/Untested


Clearly I have tested it, lol. Otherwise why would I have put right beside Not Working --"UNTESTED" :p:

lol... i'm so confuse with those word...
Working
Not Working/Untested
two different word with ooposite meaning :p:
i'l have it try also then... thx dude!!! :thumbup:
 
Junior Spellweaver
Joined
Jan 23, 2010
Messages
187
Reaction score
12
you know, this is not a bad idea at all, this could start some new things, the only thing i would say is that it does do two things:
1) dont have to run around looking for trees just make your own
2) stops auto-afkers because they have to press to make new tree then cut it

at the same time its the same as using a summoning scroll xD
but still like i said it does open up more ideas for what we can do ( like summoning a friend to you )

and i love the way you didn't just stop at ok it summons; you made it not be able to summon in icicle because its ice and only some tree spawns certain places
 
Newbie Spellweaver
Joined
Jul 4, 2010
Messages
8
Reaction score
0
2) at the same time its the same as using a summoning scroll xD

They kinda gave me the idea to try it :) after looking at their summoning scripts, it turned out to be much less confusing than I originally thought it to be. It'd be nice to add some sort of delay between the time you use the seed and the time the tree appears, however, im still getting back into lua after these last 2 years of break and currently do not know how to go about adding such feature. :p
 
Junior Spellweaver
Joined
Oct 16, 2008
Messages
197
Reaction score
1
well, this is juast a guess...
how bout you just adding the delay timer and then when it reach the delay the seed pop up...
 
Newbie Spellweaver
Joined
Jul 4, 2010
Messages
8
Reaction score
0
well, this is juast a guess...
how bout you just adding the delay timer and then when it reach the delay the seed pop up...

Would you happen to know the snippet of code for that? I know where to place the code, I just don't know what that particular code is.
 
Junior Spellweaver
Joined
Oct 16, 2008
Messages
197
Reaction score
1
how bout adding the code such as :

local delaytime = 18000
if delaytime = 1 then
tree pop up
end
 
Initiate Mage
Joined
Jul 14, 2012
Messages
1
Reaction score
0
for delay timing u need to add tables for it , use this
Code:
-- cha_timer 
if(GetMainCha(role) ~= nil and GetChaDefaultName(role) ~= nil and delay[GetChaDefaultName] == nil or delay[GetChaDefaultName] <= 18000)then
delay[GetChaDefaultName(role)] == 18000
end
if(Tree[GetChaDefaultName] ~= nil and math.mod(now_tick, 1) == 0 and now_tick > 0 then)then
delay[GetChaDefaultName(role)] == delay[GetChaDefaultName(role)] - 1
end
At the itemeffect which you will do
add this function
Code:
local summoned_tree = CreateCha(x,x,y,x,x) -- Edit this one
Tree[GetChaDefaultName(role)] = summoned_tree
end
 
Back
Top