Ir para conteúdo

Featured Replies

Postado

Cara eu tava pesquisando uma maneira de adiconar cargas na C. arrow e encontrei esse script muito conviniete para mim... acho qué o que você está pedindo.

Não fui eu que fiz o script !!

 

Add essa tag em Actions.xlm

Spoiler

<action actionid="43109" event="script" value="changeSdStones.lua"/>
<action itemid="8299" script="WandSdCharge.lua"/>

 

agora crie o script em data/actions/scripts, com o nome de  changeSdStones.lua e cole isso dentro

Spoiler

storage = 23150 --- aqui no le muevan
local time = 1 ---- tiempo de exausted para usar la palanca
local time2 = 10 ---- tiempo de exausted para usar la palanca cuando no tienen sd's en el recipiente

Sd_Cobro = 5 ---- el numero de sd's que cobrara para darte 1 stone para recargar la wand
Stone_Count = 1 ---- numero de stones que dara para recargar la wand

pos = {x = 1251, y = 862, z = 7} ---- la position donde se pondran las sd's 

function onUse(cid, item, itemEx)
if exhaustion.check(cid, storage) == true then
doPlayerSendCancel(cid, "No Puedes Usar Muy Rapido Intenta En: " ..exhaustion.get(cid, storage).." segundos.")
doSendMagicEffect({x = getPlayerPosition(cid).x, y = getPlayerPosition(cid).y - 1, z = getPlayerPosition(cid).z}, 2)
return true
end


if getTileItemById(pos, 2268).uid < 1 then
doPlayerSendTextMessage(cid, 22, "Coloca Las Sd's Aqui.")
doSendMagicEffect({x = getPlayerPosition(cid).x, y = getPlayerPosition(cid).y - 2, z = getPlayerPosition(cid).z}, 55)
doSendMagicEffect({x = getPlayerPosition(cid).x, y = getPlayerPosition(cid).y - 1, z = getPlayerPosition(cid).z}, 2)
exhaustion.set(cid, storage, time2)
return true
end

if doRemoveItem(getTileItemById(pos, 2268).uid,Sd_Cobro) then
exhaustion.set(cid, storage, time)
doPlayerAddItem(cid, 8299, Stone_Count)
doSendMagicEffect({x = getPlayerPosition(cid).x, y = getPlayerPosition(cid).y - 2, z = getPlayerPosition(cid).z}, 15)
else
doPlayerSendCancel(cid, "Necesitas Colocar 5 Sudden Death Runes.")
exhaustion.set(cid, storage, time)
end
end

 

Agora nesta mesma pasta crie outro com nome  WandSdCharge.lua e ponha isso dentro

Spoiler

 

local WandSd = 7958

function onUse(cid, item, frompos, item2, topos)
if isCreature(item2.uid) == TRUE then
doPlayerSendCancel(cid, "This item isn't use on creatures.")
return true
end

if isInArray({WandSd}, item2.itemid) == FALSE then
doPlayerSendCancel(cid, "You Can Only Use On Wand Of Sudden Death.")
doSendMagicEffect(topos, 2)
return true
end

if getItemAttribute(item2.uid, "ChargesSD") == null then
doItemSetAttribute(item2.uid, "ChargesSD", 0)
end

if getItemAttribute(item2.uid, "ChargesSD") >= 100 then
doPlayerSendCancel(cid, "Sorry You Have Limit Of 100 Charges On Your Wand.")
doSendMagicEffect(topos, 2)
return true
end

doRemoveItem(item.uid, 1)
doSendMagicEffect(topos, 38)
doItemSetAttribute(item2.uid, "ChargesSD", (getItemAttribute(item2.uid, "ChargesSD") + 1))
doItemSetAttribute(item2.uid, "name", "" ..getPlayerName(cid).. "'s "..getItemNameById(WandSd).." ["..getItemAttribute(item2.uid, "ChargesSD").." Charges]")
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Now You Have '..getItemAttribute(item2.uid, "ChargesSD")..' Charges On Your Wand Of Sudden Death.')
end

 

Agora vá em items e substitua estes aquivos respectivamente com esse ids

Spoiler

<item id="7958" article="a" name="Wand Of Sudden Death">
        <attribute key="weight" value="500" />  
        <attribute key="weaponType" value="wand" />
 <attribute key="range" value="6" />
    </item> 

    <item id="8299" name="Charges Sudden Death">
        <attribute key="weight" value="250" />
 <attribute key="description" value="You Can Charge Wand Of Sudden Death with this rare item." />
    </item>

 

Feito isso só ir em weapons.xlm e cria essas tags

Spoiler

<wand id="7958" range="4" lvl="8" mana="15" enabled="1" exhaustion="0" script="Wand Of Sudden Death.lua">
 <vocation id="1"/>
 <vocation id="5" showInDescription="0"/>
 <vocation id="2"/>
 <vocation id="6" showInDescription="0"/>
</wand>

 

Agora dentro da pasta data/weapons/script, crie o arquivo Wand Of Sudden Death.lua e cole isso dentro

Spoiler

local WandSd = 7958

local storagePlayer = 56156 -- no mover
local storageExausted = 56256 -- no mover
local timeExausted = 24 * 60 * 60 --- tiempo de el exausted despues de alcansar el maximo de ataques con la wand en horas ahi son 24 horas editen el primer numero.
local MaxAttacksWand = 100 -- maximos de tiros para que le de el exausted de el tiempo que configuraste arriva.

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -60, -1, -60, 5, 5, 4, 7)

function onUseWeapon(cid, var)

if getPlayerStorageValue(cid, storagePlayer) < 0 then
setPlayerStorageValue(cid, storagePlayer, 0)
return true
end

if getPlayerStorageValue(cid, storagePlayer) >= MaxAttacksWand then
exhaustion.set(cid, storageExausted, timeExausted)
setPlayerStorageValue(cid, storagePlayer, 0)
return true
end

if exhaustion.check(cid, storageExausted) == true then
local time = exhaustion.get(cid, storageExausted)/ 3600
local hours = math.floor(time)
local minutes = math.floor((math.floor(time*100) - hours*100) * 0.6)
local message = string.format("Depues de "..MaxAttacksWand.." ataques con tu Wand Of Sudden Death debes esperar %d Hours %d minutes para volver utilizarla.",hours,minutes)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, message )
doSendMagicEffect(getPlayerPosition(cid), 2)
return true
end



if getItemAttribute(getPlayerWeapon(cid).uid, "ChargesSD") >= 1 then
doItemSetAttribute(getPlayerWeapon(cid).uid, "ChargesSD", (getItemAttribute(getPlayerWeapon(cid).uid, "ChargesSD") - 1))
doItemSetAttribute(getPlayerWeapon(cid).uid, "name", "" ..getPlayerName(cid).. "'s "..getItemNameById(WandSd).." ["..getItemAttribute(getPlayerWeapon(cid).uid, "ChargesSD").." Charges]")
setPlayerStorageValue(cid, storagePlayer, getPlayerStorageValue(cid, storagePlayer) + 1)
doPlayerSendCancel(cid, ""..getItemAttribute(getPlayerWeapon(cid).uid, "ChargesSD").." charges lefts of wand sudden death.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have "..(MaxAttacksWand) - getPlayerStorageValue(cid, storagePlayer).." Times Lefs To Attack With Wand Of Sudden Death For This Day.")
return doCombat(cid, combat, var) and doCombat(cid, combat, var)
end
return true
end

 

Esse script funciona da seguinte forma, a primeira action você configura com o mapa, ele vai criar o item que irá adicionar as cargas na wand... este item é 8299 só ira funcionar na wand declarada na segunda action que eu postei...

 

maus pela explicação, é que eu não sou scripter

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo