Skrypty & Kody Potiony Pomoc

Status
Zamknięty.

jazik

User
Zarejestrowany
Dołączył
Czerwiec 12, 2010
Posty
46
Liczba reakcji
0
Jak zmieni? ten skrypt zeby leczy? , byl tylko dla eka od 100lvl i mia? exhaust 1500

function onUse(cid, item, frompos, item2, topos)

local level = getPlayerLevel(cid)

-- Exhausted Settings --
local exhausted_seconds = 2 -- 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)
local mana_maximum = (level * 5)
-- 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) == TRUE 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) == TRUE 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
 
Odp: Potiony Pomoc

Chcia?bym Ci pom?c, ale sam nie wiem jak to zrobi?, a liczy? na osoby kt?re potrafia co? na tym forum to jak cud z nieba. Odzywaj? sie raz na ruski rok, wiec ?ycz? Ci cierpliwo?ci :D
 
Odp: Potiony Pomoc

PHP:
local exhaustedCondition = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaustedCondition, CONDITION_PARAM_TICKS, 1500)
setConditionParam(exhaustedCondition, CONDITION_PARAM_SUBID, 100)

local vocations = {4, 8, 12}
local levelRequied = 100

function onUse(cid, item, frompos, itemEx, topos)
if getPlayerLevel(cid) < levelRequied then
	doSendMagicEffect(frompos, CONST_ME_POFF) 
	return doPlayerSendCancel(cid, "Za niski poziom.")
end
if not isInArray(vocations, getPlayerVocation(cid)) then
	doSendMagicEffect(frompos, CONST_ME_POFF) 
	return doPlayerSendCancel(cid, "Profesja nie ta.")
end
if getCreatureCondition(cid, CONDITION_EXHAUST, 100) then
	doSendMagicEffect(frompos, CONST_ME_POFF) 
	return doPlayerSendCancel(cid, "Exhausted.")
end
local uid = isPlayer(itemEx.uid) and itemEx.uid or cid
if not isPlayer(uid) then
	doSendMagicEffect(frompos, CONST_ME_POFF) 
	return doPlayerSendCancel(cid, "Tej runy mozesz uzywac tylko na graczach.") 
end
local manaMinimum = (level * 5) 
local manaMaximum = (level * 5)
doAddCondition(cid, exhaustedCondition)
doTargetCombatMana(0, uid, manaMinimum, manaMaximum, CONST_ME_MAGIC_GREEN)
return doChangeTypeItem(item.uid, item.type - 1) 
end
 
Status
Zamknięty.
Back
Do góry