Basic Tree Planting - ( Finished )

Results 1 to 10 of 10
  1. #1
    Apprentice Tazohawk is offline
    MemberRank
    Jul 2010 Join Date
    8Posts

    idea Basic Tree Planting - ( Finished )

    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

    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
    Attached Files Attached Files
    Last edited by Tazohawk; 02-03-12 at 11:41 PM. Reason: Completed Scripts


  2. #2
    Account Upgraded | Title Enabled! opexone78 is offline
    MemberRank
    Oct 2008 Join Date
    216Posts

    Re: Basic Tree Planting - ( Finished )

    btw, is it tested or not?

  3. #3
    Apprentice Tazohawk is offline
    MemberRank
    Jul 2010 Join Date
    8Posts

    Re: Basic Tree Planting - ( Finished )

    Quote Originally Posted by opexone78 View Post
    btw, is it tested or not?
    ----------------
    ----Legend----
    ----------------
    Working
    Not Working/Untested


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

  4. #4
    Account Upgraded | Title Enabled! opexone78 is offline
    MemberRank
    Oct 2008 Join Date
    216Posts

    Re: Basic Tree Planting - ( Finished )

    Quote Originally Posted by Tazohawk View Post
    ----------------
    ----Legend----
    ----------------
    Working
    Not Working/Untested


    Clearly I have tested it, lol. Otherwise why would I have put right beside Not Working --"UNTESTED"
    lol... i'm so confuse with those word...
    Working
    Not Working/Untested
    two different word with ooposite meaning
    i'l have it try also then... thx dude!!!

  5. #5
    Account Upgraded | Title Enabled! micah1121 is offline
    MemberRank
    Jan 2010 Join Date
    213Posts

    Re: Basic Tree Planting - ( Finished )

    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

  6. #6
    Apprentice Tazohawk is offline
    MemberRank
    Jul 2010 Join Date
    8Posts

    Re: Basic Tree Planting - ( Finished )

    Quote Originally Posted by micah1121 View Post
    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

  7. #7
    Account Upgraded | Title Enabled! opexone78 is offline
    MemberRank
    Oct 2008 Join Date
    216Posts

    Re: Basic Tree Planting - ( Finished )

    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...

  8. #8
    Apprentice Tazohawk is offline
    MemberRank
    Jul 2010 Join Date
    8Posts

    Re: Basic Tree Planting - ( Finished )

    Quote Originally Posted by opexone78 View Post
    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.

  9. #9
    Account Upgraded | Title Enabled! opexone78 is offline
    MemberRank
    Oct 2008 Join Date
    216Posts

    Re: Basic Tree Planting - ( Finished )

    how bout adding the code such as :

    local delaytime = 18000
    if delaytime = 1 then
    tree pop up
    end

  10. #10
    Novice SaeedYellow is offline
    MemberRank
    Jul 2012 Join Date
    1Posts

    Re: Basic Tree Planting - ( Finished )

    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



Advertisement