Eu fiz em para o Luiiz1
mais achei util postar para todo mundo :]
ve o video
e um anel que quando usado almenta o LIFE, MANA e a spd do player por exemplo ele tem 100 de hp ai usando o anel ele passa a ter 1100
( configuravel )
do lado da pasta data tem uma pasta chamada MODS
vai na pasta MODS e cria um arquivo lifeRingSystem.xml
<?xml version="1.0" encoding="UTF-8"?> <mod name="Life ring System" version="1.0" author="Willian Batista Cima" contact="none" enabled="yes"> ----------------------------------------------------------------------- <config name="lifeRingSystem"><![CDATA[ lifeRingSystem = { storageBase = 9000101 , ringOn = 2127 , ringOff = 2127 , vocHp = { 5 , 5, 10, 15, 5 , 5, 10, 15 } , -- vocation 1 to 8 hp gain if lv up using the ring ! vocSp = { 30, 30 ,15, 5, 30, 30 ,15, 5 } , -- vocation 1 to 8 sp gain if lv up using the ring ! RemoveCreatureConditions = false , -- -- MLVGAIN = 200 , -- not sopported yet ! HEALTHGAIN = 1000 , -- hp gain HEALTHLOSS = 50 , -- hp loss if hitted by effect MANAGAIN = 1000 , -- mana gain MANALOSS = 50 , -- mana loss if hitted by effect SPEEDGAIN = 1000 , EFFECTChance = 90 , -- mean 50% of chance to happens ( 0 mean never do ) ( 100 alws do ) EFFECTRange = 2 , -- 2X2 square range 0 means player position EFFECTPlayer ={ [1] = { [sTATSCHANGE_HEALTHGAIN]= CONST_ME_YELLOW_RINGS, [sTATSCHANGE_HEALTHLOSS] = CONST_ME_YELLOW_RINGS , -- [sTATSCHANGE_MANAGAIN] = CONST_ME_HOLYAREA , [sTATSCHANGE_MANALOSS] = CONST_ME_HOLYAREA , ringinuse = CONST_ME_FIREWORK_YELLOW, disshot = CONST_ANI_SMALLHOLY , } , [0] = { [sTATSCHANGE_HEALTHGAIN]= CONST_ME_FIREWORK_RED, [sTATSCHANGE_HEALTHLOSS] = CONST_ME_EXPLOSIONAREA, [sTATSCHANGE_MANAGAIN] = CONST_ME_MAGIC_RED , [sTATSCHANGE_MANALOSS] = CONST_ME_FIREAREA , ringinuse = CONST_ME_FIREWORK_RED, disshot = CONST_ANI_FIRE , } } } -- lifeRingSystem.EFFECTPlayer.[2] = lifeRingSystem.EFFECTPlayer.[0] -- GM gets GIRLS effects lifeRingSystem.storageLv = lifeRingSystem.storageBase+1 lifeRingSystem.storageHp = lifeRingSystem.storageBase+2 lifeRingSystem.storageSp = lifeRingSystem.storageBase+3 -- lifeRingSystem.storageSped = lifeRingSystem.storageBase+4 -- better remove all storage but base ]]></config> ----------------------------------------------------------------------- <event type="login" name="lifeRingSystem_login" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid,"lifeRingSystem_gain_effect") registerCreatureEvent(cid,"lifeRingSystem_think") return true end ]]></event> ----------------------------------------------------------------------- <event type="think" name="lifeRingSystem_think" event="script"><![CDATA[ domodlib('lifeRingSystem') local cfg = lifeRingSystem function onThink(cid, interval) if lifeRingSystem_last_interval == nil then lifeRingSystem_last_interval= os.clock() end if (os.clock() - lifeRingSystem_last_interval) > 2 then -- execute every 2 sec if isPlayer(cid) then if getPlayerStorageValue(cid, cfg.storageBase ) == 1 then local pos = getPlayerPosition(cid) local r = cfg.EFFECTRange local toPositions = { x = pos.x + math.random( -r , r ), y = pos.y + math.random(-r,r), z = pos.z} doSendMagicEffect( toPositions , cfg.EFFECTPlayer[getPlayerSex(cid)].ringinuse ) end lifeRingSystem_last_interval= os.clock() end return true end return false end ]]></event> ----------------------------------------------------------------------- <event type="statschange" name="lifeRingSystem_gain_effect" event="script"><![CDATA[ domodlib('lifeRingSystem') local cfg = lifeRingSystem function onStatsChange(cid, attacker, type, combat, value) if getPlayerStorageValue(cid, cfg.storageBase ) == 1 then if math.random(1,100) < cfg.EFFECTChance and isInArray( {1,2,3,4} , type ) then local pos = getPlayerPosition(cid) local r = cfg.EFFECTRange local toPositions = { x = pos.x + math.random( -r , r ), y = pos.y + math.random(-r,r), z = pos.z} doSendDistanceShoot( {x = pos.x - math.random(-7,7), y = pos.y + math.random(-6,6), z = pos.z}, toPositions, cfg.EFFECTPlayer[getPlayerSex(cid)].disshot ) doSendMagicEffect( toPositions , cfg.EFFECTPlayer[getPlayerSex(cid)][ type ] ) local thing = getThingfromPos(toPositions) if isPlayer(thing) then if cfg.RemoveCreatureConditions then doRemoveConditions(thing) end doCreatureAddHealth(thing, HEALTHLOSS ) doCreatureAddMana(thing, getCreatureMaxMana(thing)-getCreatureMana(thing)) end end end return true end ]]></event> ----------------------------------------------------------------------- <movevent type="Equip" itemid="2127" slot="ring" event="script"><![CDATA[ domodlib('lifeRingSystem') local cfg = lifeRingSystem function onEquip(cid, item, slot) if(item.itemid == cfg.ringOn) then if getPlayerAccess(cid) > 1 then return false end if getPlayerStorageValue(cid, cfg.storageBase ) ~= 1 then setPlayerStorageValue(cid, cfg.storageLv , getPlayerLevel(cid) ) setPlayerStorageValue(cid, cfg.storageHp , getCreatureMaxHealth(cid) ) setPlayerStorageValue(cid, cfg.storageSp , getPlayerMaxMana(cid) ) -- setPlayerStorageValue(cid, cfg.storageSped , getCreatureSpeed(cid) ) setPlayerStorageValue(cid, cfg.storageBase , 1 ) setCreatureMaxHealth(cid, (getPlayerStorageValue(cid, cfg.storageHp )+cfg.HEALTHGAIN) ) setCreatureMaxMana(cid, (getPlayerStorageValue(cid, cfg.storageSp )+cfg.MANAGAIN) ) doChangeSpeed(cid, ( getCreatureSpeed(cid)+cfg.SPEEDGAIN) ) -- getPlayerStorageValue(cid, cfg.storageSped ) end return true end return false end ]]></movevent> ----------------------------------------------------------------------- <movevent type="DeEquip" itemid="2127" slot="ring" event="script"><![CDATA[ domodlib('lifeRingSystem') local cfg = lifeRingSystem function onDeEquip(cid, item, slot) if(item.itemid == cfg.ringOff) then setPlayerStorageValue(cid, cfg.storageBase , 2 ) if getPlayerAccess(cid) > 1 then return false end if getPlayerStorageValue(cid, cfg.storageLv ) < getPlayerLevel(cid) and getPlayerAccess(cid) < 2 and getPlayerVocation(cid) > 0 then setPlayerStorageValue(cid, cfg.storageHp , ( (getPlayerLevel(cid)-getPlayerStorageValue(cid, cfg.storageLv )) *cfg.vocHp[getPlayerVocation(cid)]) +getCreatureMaxHealth(cid) ) setPlayerStorageValue(cid, cfg.storageSp , ( (getPlayerLevel(cid)-getPlayerStorageValue(cid, cfg.storageLv )) *cfg.vocSp[getPlayerVocation(cid)]) +getPlayerMaxMana(cid) ) end setCreatureMaxHealth(cid, getPlayerStorageValue(cid, cfg.storageHp ) ) setCreatureMaxMana(cid, getPlayerStorageValue(cid, cfg.storageSp ) ) doCreatureAddHealth(cid, getCreatureHealth(cid)+1 ) -- getCreatureMaxHealth(cid) doCreatureAddMana(cid, getCreatureMana(cid)+1 ) -- getCreatureMaxMana(cid) -- speed base level 218 + ( 2*level) http://www.tibiabr.com/calc_de_velocidade doChangeSpeed(cid, ( -getCreatureSpeed(cid)+ 218+(2*getPlayerLevel(cid) ) ) ) return true end return false end ]]></movevent> <talkaction words="!ringstatus" event="script"><![CDATA[ domodlib('lifeRingSystem') local cfg = lifeRingSystem function onSay(cid, words, param, channel) if(param ~= '') then doPlayerSendCancel(cid, 'no need a para. ') return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, getPlayerName(cid) .. " have spd now " .. getCreatureSpeed(cid) ) return true end ]]></talkaction> </mod>
como configurar
lifeRingSystem = { storageBase = 9000101 , RemoveCreatureConditions = false , -- HEALTHGAIN = 1000 , -- hp gain MANAGAIN = 1000 , -- mana gain SPEEDGAIN = 1000 , EFFECTChance = 90 , -- mean 50% of chance to happens ( 0 mean never do ) ( 100 alws do ) EFFECTRange = 2 , -- 2X2 square range 0 means player position }
HEALTHGAIN quantidade de vida que ganha ao usar o anel
MANAGAIN quantidade de mana que ganha ao usar o anel
SPEEDGAIN quantidade de spd que ganha ao usar o anel
EFFECTChance chance de fazer um atk especial quando ( quando ele e atacado ?) ou (uma cura especial quando se cura ?)
EFFECTRange ate onde o efeito atinge ( 2 = 2 quadrados ao redor do jogador 0 = o efeito sai so no player e nao atige
outros jogadores [ fazendo isso o player peder vida ao usar o anel { minimo preco a pagar por usar o anel}])
)
TA ai duvida so postar !