• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[REQUEST] NPC for water pipe

Maxens

Member
Joined
Apr 9, 2009
Messages
479
Reaction score
7
Location
Germany
Hello everyone! :)

i got a really nice idea but i dont know how to script that! maybe you could do that for me...I'll add rep to u ;)

1. A NPC Who is called "Marijuana Dealer". The NPC sells Marijuana. 1Marijuana costs 5cc.

2. I can only use the waterpipe if i have marijuana. If i have 1 marijuana i can use the water pipe 1 time. If i used the water piope the marijuana removes automatically. If i successfully used the water pipe the player should get drunk, bubbles should be on the water pipe and the player should get a message "That was strong shit."

Would be awesome i think!<3
 
ok, i made the script. You just have to add the itemid's
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition) 
local item = 2099
if  item.itemid == 5953 then
doPlayerRemoveItem(cid, 5953, 1)
doCreatureSetNoMove(cid, cannotMove)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "That was strong shit!") 
else
doSendMagicEffect(getCreaturePosition(firstDragonFound), CONST_ME_CAKE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have marijuana!") 
end
return true
end
if this script doesn't work, tell me the errors and I will fix it. I haven't scripted very much lately, so I'm not sure if it will work.
 
Last edited:
This script isnt working :(

Also I need a NPC who sells marijuana for 5cc... 1 Marijuana costs 5cc - 100 Marijuana costs 500cc

make that they can say "trade" and can buy how much they want to or how mcuh mone they have ;P
 
For the npc you can just use a shop npc, like the one in your server who sells items.
For the waterpipe to be sure I understand this right.
Someone clicks use on the waterpipe, if he has marijuana the player becomes drunk for some time and the marijuana will be removed. There will be a bubble on the waterpipe when he used it and will get a message: That was strong shit.
Do you want something else? like adding mana for some time or exhaustion?
 
Okey i will try it! :D

yep I mean exactly that ;) okey make an exhaust of 3 seconds and if the player is exhausted he gets a message "Chill...Junky..."

Thanks ;)
 
1. I dont like the idea with more hp/mana :P

2. My server is a highexp server...5cc wouldnt be that much :)

3. This script is just for fun to make something "unique" for players :P I didnt see something like that anywhere else :P
 
LUA:
local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 30000)

local config = {
    amount = 100, 
    time = 3, 
    exhaust = {
        storage = 1000,
        time = 3, 
    }
}

local function doRegeneration(cid, amount, seconds)
    if seconds <= 0 then
        return false
    end
    doCreatureAddMana(cid, amount)
    doSendMagicEffect(getThingPos(cid), 25)
    return addEvent(doRegeneration, 1000, cid, amount, seconds - 1)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if exhaustion.check(cid, config.exhaust.storage) then        
        return doPlayerSendCancel(cid, "Chill..Junky...")
    end
    if getPlayerItemCount(cid, 5953) >= 1 then
    doPlayerRemoveItem(cid, 5953, 1)
    doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)    
    doRegeneration(cid, config.amount, config.time)
    exhaustion.set(cid, config.exhaust.storage, config.exhaust.time)
    else
	doPlayerSendCancel(cid, 'You need marijuana for this.')
    end
    return true
end

Oh already made it with mana add, but you can still remove it if you don't like it.
Ps: Don't test this with a god char, because they don't have exhaust :p
 
Last edited:
Oh forgot that :p
LUA:
local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 30000)

local config = {
    amount = 100, 
    time = 3, 
    exhaust = {
        storage = 1000,
        time = 3, 
    }
}

local function doRegeneration(cid, amount, seconds)
    if seconds <= 0 then
        return false
    end
    doCreatureAddMana(cid, amount)
    doSendMagicEffect(getThingPos(cid), 25)
    return addEvent(doRegeneration, 1000, cid, amount, seconds - 1)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if exhaustion.check(cid, config.exhaust.storage) then        
        return doPlayerSendCancel(cid, "Chill..Junky...")
    end
    if getPlayerItemCount(cid, 5953) >= 1 then
    doPlayerRemoveItem(cid, 5953, 1)
    doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)
    doPlayerSendTextMessage(cid, 25, "That was strong shit.")    
    doRegeneration(cid, config.amount, config.time)
    exhaustion.set(cid, config.exhaust.storage, config.exhaust.time)
    else
	doPlayerSendCancel(cid, 'You need marijuana for this.')
    end
    return true
end
 
I think I added u rep fpr the casino owner...or u were the last person who recieved rep from me :P

The bubbles are on the player...could u do that the bubbles are on the water pipe please? :P
 
but where is the bong, all that happens with mine is i click the marijuana and it says thats some good shit i never get the chil junky message, and wheres the script for the pipe at? like everything works good except the fact i dont need a pipe to use it jsut have to click the marijuana
 
Back
Top