Ir para conteúdo

[ Resolvido ]!mana -- !life


nyuchiha

Posts Recomendados

Preciso colocar nesse script uma certa quantidade de reset ( tipo quero q cada player so possa resetar 1 veiz)

E que ele adicione vocacao ( elder , elite etc )

 

 

function onSay(cid, words, param)

local level = 30 --level pra ser resetado

local RemainingLvl = 8 --lvl que ele ficara depois do reset

local pid = getPlayerGUID(cid)

 

function addReset(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,36874,resets+1)

return true

end

 

function getResets(cid)

resets = getPlayerStorageValue(cid,36874)

if resets < 0 then

resets = 0

end

return resets

end

 

if getPlayerLevel(cid) >= level then

addReset(cid)

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

doPlayerPopupFYI(cid,"You now was reset, you have "..getResets(cid).." reset.")

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..RemainingLvl..", `experience` = 0 WHERE `id` = "..pid)

 

else

doPlayerSendCancel(cid, "You need to have level "..level.." or more you may be reset.")

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)

end

 

return TRUE

end

 

 

O de baixo é um ring de transformação ( o problema é que quando acaba o dinheiro ele quebra).

Queria tirar essa função vlw

 

-- >> Config --

 

local outfit =

{

-- Girls

{

lookType = 12,

lookHead = 19,

lookBody = 53,

lookLegs = 92,

lookFeet = 79,

lookAddons = 0

},

-- Boys

{

lookType = 12,

lookHead = 19,

lookBody = 79,

lookLegs = 3,

lookFeet = 81,

lookAddons = 0

}

}

 

local coinID = 2160

local wastingInterval = 1000

local wastingQuantity = 1

local triggerQuantity = 100

local warnOnLowSupply = TRUE

local lowSupplyMargin = 200

local storage = 50780

 

-- Config << --

 

local condition1 = createConditionObject(CONDITION_ATTRIBUTES)

setConditionParam(condition1, CONDITION_PARAM_TICKS, -1)

setConditionParam(condition1, CONDITION_PARAM_SKILL_FIST, 120)

setConditionParam(condition1, CONDITION_PARAM_SKILL_FISHING, 120)

setConditionParam(condition1, CONDITION_PARAM_SKILL_CLUB, 3200)

setConditionParam(condition1, CONDITION_PARAM_SKILL_SWORD, 3200)

setConditionParam(condition1, CONDITION_PARAM_SKILL_AXE, 3200)

setConditionParam(condition1, CONDITION_PARAM_SKILL_DISTANCE, 3200)

setConditionParam(condition1, CONDITION_PARAM_SKILL_SHIELD, 120)

setConditionParam(condition1, CONDITION_PARAM_SKILL_FISHING, 120)

setConditionParam(condition1, CONDITION_PARAM_STAT_MAGICPOINTS, 15000)

setConditionParam(condition1, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 180)

setConditionParam(condition1, CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 180)

 

local condition2 = createConditionObject(CONDITION_HASTE)

setConditionParam(condition2, CONDITION_PARAM_TICKS, -1)

setConditionFormula(condition2, 2.5, 0, 3.0, 0)

 

local area = createCombatArea({

{0, 0, 0, 1, 0, 0, 0},

{0, 1, 0, 0, 0, 1, 0},

{0, 0, 0, 0, 0, 0, 0},

{1, 0, 0, 2, 0, 0, 1},

{0, 0, 0, 0, 0, 0, 0},

{0, 1, 0, 0, 0, 1, 0},

{0, 0, 0, 1, 0, 0, 0}

})

 

local animCombat =

{

createCombatObject(),

createCombatObject()

}

 

local sexyEffect =

{

CONST_ME_FIREWORK_RED,

CONST_ME_FIREWORK_YELLOW,

CONST_ME_MAGIC_RED,

CONST_ME_MAGIC_GREEN

}

 

setCombatParam(animCombat[2], COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)

setCombatParam(animCombat[2], COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)

setCombatParam(animCombat[1], COMBAT_PARAM_EFFECT, CONST_ME_FIREWORK_RED)

setCombatParam(animCombat[1], COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)

 

setCombatArea(animCombat[2], area)

setCombatArea(animCombat[1], area)

 

local function StopSuperForm(cid)

if (getPlayerStorageValue(cid, storage) == 1) then

setPlayerStorageValue(cid, storage, 0)

doRemoveCondition(cid, CONDITION_OUTFIT)

doRemoveCondition(cid, CONDITION_ATTRIBUTES)

doRemoveCondition(cid, CONDITION_HASTE)

end

return TRUE

end

 

local function SuperForm(cid, sexIndex)

if (isCreature(cid)) then

if (getPlayerStorageValue(cid, storage) == 1) then

local goldLeft = getPlayerItemCount(cid, coinID)

if (goldLeft >= wastingQuantity) then

local position = getCreaturePosition(cid)

doPlayerRemoveItem(cid, coinID, wastingQuantity)

doSendMagicEffect(position, sexyEffect[sexIndex + 2])

doSendMagicEffect(position, sexyEffect[sexIndex])

if (goldLeft <= lowSupplyMargin and warnOnLowSupply == TRUE) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Coins left: " ..(goldLeft - wastingQuantity) .. "!")

end

addEvent(SuperForm, wastingInterval, cid, sexIndex)

else

doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your bangle has been destroyed!")

doPlayerRemoveItem(cid, 2127, 1)

return StopSuperForm(cid)

end

end

end

end

 

function onEquip(cid, item, slot)

if (getPlayerItemCount(cid, coinID) > triggerQuantity and getPlayerStorageValue(cid, storage) ~= 1) then

local sexIndex = getPlayerSex(cid) + 1

doCombat(cid, animCombat[sexIndex], numberToVariant(cid))

doSetCreatureOutfit(cid, outfit[sexIndex], -1)

setPlayerStorageValue(cid, storage, 1)

doAddCondition(cid, condition1)

doAddCondition(cid, condition2)

doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))

doPlayerAddMana(cid, getPlayerMaxMana(cid) - getPlayerMana(cid))

doPlayerRemoveItem(cid, coinID, triggerQuantity)

SuperForm(cid, sexIndex)

elseif (getPlayerStorageValue(cid, storage) == 1) then

doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You cannot equip this now!")

else

doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You do not have enough coins!")

end

return TRUE

end

 

function onDeEquip(cid, item, slot)

return StopSuperForm(cid)

end

Editado por DeathAngels
Link para o comentário
Compartilhar em outros sites

1ª talkaction:

 

Crie um arquivo chamado mana.lua em talkactions/scripts

 

function onSay(cid, words, param)

local mana = getCreatureMana(cid)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "Voce tem "..mana.." mana points.")

end

 

em talkactions.xml:

 

<talkaction words="!mana" script="mana.lua"/> 

 

2ª talkaction

 

Crie um arquivo chamado health.lua em talkactions/scripts

 

function onSay(cid, words, param)

local health = getCreatureHealth(cid)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Voce tem "..health.." health points.")

end

 

em talkactions.xml:

 

<talkaction words="!health" script="health.lua"/>

 

Qualquer erro me avise

Editado por duduzz
Link para o comentário
Compartilhar em outros sites

Mande o script do globalevents. O bau que dá xp:

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
storage = 16548,
xp = 1500
}
        if getPlayerStorageValue(cid, config.storage) <= 0 then
           doPlayerAddExp(cid, config.xp)
           doPlayerSendTextMessage(cid,25,"Você recebeu " .. tonumber(config.xp) .. " experience points.")
           setPlayerStorageValue(cid, config.storage, 1)
        else
           doPlayerSendCancel(cid, "Você já obteve sua recompensa.")
        end
        return TRUE
        end

 

 

flw

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...
×
×
  • Criar Novo...