• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Weed System Request/Help

Blackcody

RiseOfTibia Owner
Joined
Aug 31, 2008
Messages
136
Reaction score
1
rme2011030720191860.png
:blink:
 
ahuahuahua you could make a NPC Bob Marley that changes marijuana for bless or something like this

Jah bless :]
 
found the script to smoke it, now all you need is a script to grow it!
Action: Release: Joint rolling -- Must see :]
XML:
<action itemid="7499" script="other/blunt.lua" />
<action itemid="4853" script="other/roll.lua" />
<action itemid="5865" script="other/grinder.lua" />

blunt.lua
LUA:
local condition = createConditionObject(CONDITION_ATTRIBUTES)
 
setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000) -- 2 minutes
 
setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, 50)
 
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, 50)
 
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 50)
 
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, 50)
 
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, -100)
 
 
 
Weed_Text = {{"F**k,", "Im high!"},{"*cough*", "*cough*"},{"Get high", "Ere day."},{"This...", "must be...", "labrador!"},{"*cough*", "*cough*"},{"*cough*", "*cough*"},{"420", "24/7", "365"},{"Because I", "got high", "because I", "got high", "because I", "got High!", "Ladeeda-", "-dadadah"},{"420", "24/7", "365"}}
function AnimTexter(parameters)
     doSendAnimatedText(parameters.pos,parameters.text,parameters.color)
     delay10 = delay10+400
end
 
 
 
function onUse(cid,item,frompos,item2,topos)
     local playerpos = getPlayerPosition(cid)
     local color = {}
     local Weed_Text_Div = {}
     delay10 = 0
     local random_number = math.random(1,table.getn(Weed_Text))
     Weed_Text_Div = Weed_Text[random_number]
     if(getPlayerItemCount(cid,item.itemid)>= 1) then
           Weedpos = playerpos
     else
           Weedpos = playerpos
     end
     local parameters1 = { pos = Weedpos, text = Weed_Text_Div[1], color = math.random(150,190)}
     local parameters2 = { pos = Weedpos, text = Weed_Text_Div[2], color = math.random(150,190)}
     local parameters3 = { pos = Weedpos, text = Weed_Text_Div[3], color = math.random(150,190)}
     local parameters4 = { pos = Weedpos, text = Weed_Text_Div[4], color = math.random(150,190)}
     local parameters5 = { pos = Weedpos, text = Weed_Text_Div[5], color = math.random(150,190)}
     local parameters6 = { pos = Weedpos, text = Weed_Text_Div[6], color = math.random(150,190)}
     local parameters7 = { pos = Weedpos, text = Weed_Text_Div[7], color = math.random(150,190)}
     local parameters8 = { pos = Weedpos, text = Weed_Text_Div[8], color = math.random(150,190)}
     local parameters9 = { pos = Weedpos, text = Weed_Text_Div[9], color = math.random(150,190)}
     addEvent(AnimTexter,400,parameters1)
     addEvent(AnimTexter,1000,parameters2)
     addEvent(AnimTexter,1700,parameters3)
     addEvent(AnimTexter,2100,parameters4)
     addEvent(AnimTexter,2700,parameters5)
     addEvent(AnimTexter,3600,parameters6)
     addEvent(AnimTexter,4100,parameters7)
     addEvent(AnimTexter,4600,parameters8)
     addEvent(AnimTexter,5000,parameters9)
 
if doTargetCombatCondition(0, cid, condition, CONST_ME_POFF) == LUA_ERROR then
		return FALSE
end
    if doCreatureSay(cid, "Toke it up!", TALKTYPE_ORANGE_1) then
        if math.random(1, 3) == 1 then
            doRemoveItem(item.uid,1) 
            doCreatureSay(cid, "Its Cashed.", TALKTYPE_ORANGE_1)
        end
    end
end

roll.lua
LUA:
local groundmarijuana = {2244}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	-- Rolling a blunt
	if item.itemid == 4853 then  -- Rolling paper ID
		if isInArray(groundmarijuana, itemEx.itemid) == TRUE then
			doRemoveItem(item.uid, 1)
			doRemoveItem(itemEx.uid, 1)
			doPlayerAddItem(cid, 7499, 1)
 
end
 
	else
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	return FALSE
end

grinder.lua
LUA:
local marijuana = {5953}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	-- Rolling a blunt
	if item.itemid == 5865 then  -- Grinder ID
		if isInArray(marijuana, itemEx.itemid) == TRUE then
 
			doRemoveItem(itemEx.uid, 1)
			doPlayerAddItem(cid, 2244, 1)
 
end
 
	else
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	return FALSE
end

Marijuana: 5953
Rolling paper: 4853
Blunt: 7499
Ground marijuana: 2244
Grinder: 5865

This is an old script so it may need some changes.
 
Back
Top