• 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!

Potrzebny skrypt!

vimoco

ۤ
Joined
Jan 11, 2009
Messages
1,011
Reaction score
9
cześć

Potrzebuje skryptu na infinity mana potion, który się nie konczy i daje random mane, i też pytanie 2 jak stworzyć magic vial żeby 1 miał dawać mane, a inny hp? :P
coś jak health potion, tylko że zielony jest w srodku ;P
 
Nie, random czyli przykładowo 100-200 każdej profesjii tak samo.

@edit
spróbuje sobie poradzić, ciul nie będę leniem xd
 
Last edited:
Dobra, takie coś mi wyszło
LUA:
// Infitiny Mana Potion [random mana]
// by vimoco
local MIN = 300
local MAX = 500

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) == FALSE then
		return FALSE
	end

	if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end

	if doPlayerAddMana(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
		return FALSE
	end

	doAddCondition(cid, exhaust)
	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
	return TRUE
end

Tylko nie wiem, jak teraz zrobić 2 takie viale 1 daje HP, a 2 MANE, ma ktoś pomysł?
 
Last edited:
A niech ci będzie to co chciałeś na gg ;)

Actions.xml

Code:
<action itemid="7488" script="[B]infinitypotion.lua[/B]"/>
<action itemid="7478" script="[B]healthpotion.lua[/B]"/>

infinitypotion.lua

Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local manaAdd = {
    ["Sorcerer"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Druid"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Paladin"]={math.random(75, 125), math.random(180, 220), math.random(180, 220)}, ["Knight"]={math.random(75, 125), math.random(75, 125), math.random(75, 125)}, 
    ["Master Sorcerer"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Elder Druid"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Royal Paladin"]={math.random(75, 125), math.random(180, 220), math.random(180, 220)}, ["Elite Knight"]={math.random(75, 125), math.random(75, 125), math.random(75, 125)}
    }
    if(isPlayer(itemEx.uid) == TRUE) then
        if(hasCondition(itemEx.uid, CONDITION_EXHAUST) == FALSE) then
            if(getPlayerLevel(itemEx.uid) < 50) then
              doCreatureAddMana(itemEx.uid, manaAdd[getPlayerVocationName(itemEx.uid)][1])
            elseif(getPlayerLevel(itemEx.uid) >= 50) and (getPlayerLevel(itemEx.uid) < 80) then
              doCreatureAddMana(itemEx.uid, manaAdd[getPlayerVocationName(itemEx.uid)][2])
            else
              doCreatureAddMana(itemEx.uid, manaAdd[getPlayerVocationName(itemEx.uid)][3])
            end
              doAddCondition(itemEx.uid, exhaust)
              doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
              doSendAnimatedText(getCreaturePosition(itemEx.uid), "Aaaah...", TEXTCOLOR_DARKYELLOW)
        else
          doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
          return TRUE
        end
    else
      return FALSE
    end
end

healthpotion.lua

Code:
local MIN = 650
local MAX = 1550

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1500))

function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end

if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end

if doCreatureAddHealth(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
return FALSE
end

doAddCondition(cid, exhaust)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
return TRUE
end
 
dziękuje :*

tylko ten infinity mana potion nie chce działać.. jak go stworzę:
/i 7488 1
coś źle robie?
 
"You can use the object" ;'o
I ten vial wygłada jak by był pusty w srodku, więc nie wiem czemu tak.
 
no to nie wiem, wszystko git jest.. hp działa tylko ten infinity nie działa ;:/
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/infinitypotion.lua:onUse

data/actions/scripts/infinitypotion.lua:11: attempt to index field '?' (a nil value)
stack traceback:
        data/actions/scripts/infinitypotion.lua:11: in function <data/actions/scripts/infinitypotion.lua:3>
 
no to nie wiem, wszystko git jest.. hp działa tylko ten infinity nie działa ;:/
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/infinitypotion.lua:onUse

data/actions/scripts/infinitypotion.lua:11: attempt to index field '?' (a nil value)
stack traceback:
        data/actions/scripts/infinitypotion.lua:11: in function <data/actions/scripts/infinitypotion.lua:3>

A jakiego silnika używasz? ^_^
 
Back
Top