• 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
 
Use the pipe instead of the marijuana, so add it with the itemid of the pipe (or actionid/uniqueid if it's not for all pipes with that id) in actions.xml.
The exhaustion only works for players, not for gods.
 
Haha I actually just figured it out i had the marijuana in the xml and not the pipe, but thanks anyways i was wonder since you made that script could you help me out with one for beer to get drunk? using the item id 2015 for the beer bottle, and make it so the sayings come over your head like the stuffed dragon does when you click him and when you do that effect 31 goes over your character and the saying he will say is "Gettin Tipsy" and "I'mmm Nawtt Drunkknk" and it will add the drunk effects
 
You can use the same script, just change the id, with the magic effect you can doSendMagicEffect(getThingPos(cid), 25) like in the script but then with 31.
For the orange text.
Code:
local text = {""Gettin Tipsy", "I'mmm Nawtt Drunkknk"}
doCreatureSay(cid, text[math.random(#text)], TALKTYPE_MONSTER)
 
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 need msg of thats was strong shit to appear to another players on default
 
Back
Top