What's new

Skrypty & Kody Potion Skrypt

Status
Not open for further replies.

wacha121

User
Joined
Nov 8, 2009
Messages
37
Reaction score
0
Witam potrzebuje skrypt do silnika tfs na great mana potion kt?ry bedzie dawa? co kilka lvli wiecej many np co 100 lvli o 300 many wiecej
 

R A H

Senior User
Joined
May 24, 2014
Messages
1,342
Reaction score
47
Odp: Potion Skrypt

Google.PL

---------- Tre?? dodana o 15:51 ----------

Google.PL
 

wacha121

User
Joined
Nov 8, 2009
Messages
37
Reaction score
0
Odp: Potion Skrypt

sory kolego ale szukam juz kilka dni tego skryptu i nic nie moge znalesc na ten temat
 

wacha121

User
Joined
Nov 8, 2009
Messages
37
Reaction score
0
Odp: Potion Skrypt

prubowales juz cos takiego to nie chce mi czytac tego silnik skompletowal bys mi caly skrypt jak to ma wyglodac

---------- Tre?? dodana o 17:13 ----------

local MIN = 500
local MAX = 600
local EMPTY_POTION = 7635

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((not(isSorcerer(itemEx.uid) or isDruid(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 80) and getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) then
doCreatureSay(itemEx.uid, "Only sorcerers and druids of level 80 or above may drink this fluid.", TALKTYPE_ORANGE_1)
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)
doRemoveItem(item.uid, 1)
doPlayerAddItem(cid, EMPTY_POTION, 1)
return TRUE
end

---------- Tre?? dodana o 17:15 ----------

co mia? bym zmieni? w tym skrypcie ?eby on dzia?a? jak trzeba prosz? o pomoc
 

Pucek1993

Active User
Joined
Feb 4, 2016
Messages
71
Reaction score
1
Odp: Potion Skrypt

PHP:
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local MIN = (level * 5) + (mlevel * 8)
local MAX = (level * 9) + (mlevel * 9)
local EMPTY_POTION = 7635

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((not(isSorcerer(itemEx.uid) or isDruid(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 80) and getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) then
doCreatureSay(itemEx.uid, "Only sorcerers and druids of level 80 or above may drink this fluid.", TALKTYPE_ORANGE_1)
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)
doRemoveItem(item.uid, 1)
doPlayerAddItem(cid, EMPTY_POTION, 1)
return TRUE
end

Nie testowane, sprawd? czy dzia?a.
 

wacha121

User
Joined
Nov 8, 2009
Messages
37
Reaction score
0
Odp: Potion Skrypt

kurde nie dzia?a ;/ masz jeszcze jaki? inny pomys? jak to zrobic
 

wacha121

User
Joined
Nov 8, 2009
Messages
37
Reaction score
0
Odp: Potion Skrypt

masz tu screna sam zobacz

---------- Tre?? dodana o 22:22 ----------

masz tu screna sam zobacz
hjhpng_ssxaaqp.png
[/url][/IMG]
 

Dark Magican

Senior User
Joined
Apr 13, 2009
Messages
677
Reaction score
42
Odp: Potion Skrypt

PHP:
function onUse(cid, item, frompos, item2, topos)
 
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
 
-- Exhausted Settings --
local exhausted_seconds = 1 -- How many seconds manarune will be unavailible to use. --
local exhausted_storagevalue = 7000 -- Storage Value to store exhaust. It MUST be unused! --
-- Exhausted Settings END --
 
-- Mana Formula Settings --
-- You can use "level" and "mlevel" --
local mana_minimum = (level * 5) + (mlevel * 8)
local mana_maximum = (level * 5) + (mlevel * 8)
-- Mana Formula Settings END --
 
local mana_add = math.random(mana_minimum, mana_maximum)
 
-- We check the charges. --
if(item.type > 1) then
-- Exhausted check. --
if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
-- Entity is player? --
if(isPlayer(item2.uid) == 1 or item2.uid == cid) then
doSendMagicEffect(topos,28)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
doPlayerAddMana(item2.uid, mana_add)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doChangeTypeItem(item.uid, item.type - 1)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Tej runy mozesz uzywac tylko na graczach.")
end
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Poczekaj chwilke -.^")
end
else
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Poczekaj chwilke -.^")
else
if(isPlayer(item2.uid) == 1 or item2.uid == cid) then
doSendMagicEffect(topos,28)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
doPlayerAddMana(item2.uid, mana_add)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Tej runy mozesz uzywac tylko na graczach.")
end
end
end
 
return 1
end

http://tibia.net.pl/threads/558629-Manarune-8-6?highlight=manarune

Ten skrypt dzia?a na pewno. Testowane na 0.2.10 tfs 8.10
 
Status
Not open for further replies.
Top