OTServ
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.
Dirección Ip
[ACTION] Item Upgrade System 3
Conectarse

Recuperar mi contraseña

Buscar
 
 

Resultados por:
 

 


Rechercher Búsqueda avanzada

Mejores posteadores
XxStroksxX (463)
[ACTION] Item Upgrade System Vote1111[ACTION] Item Upgrade System Vote2111[ACTION] Item Upgrade System Vote3111 
~*~[:Đαяќ:]~[:тιβια:]~*~ (366)
[ACTION] Item Upgrade System Vote1111[ACTION] Item Upgrade System Vote2111[ACTION] Item Upgrade System Vote3111 
spoor (83)
[ACTION] Item Upgrade System Vote1111[ACTION] Item Upgrade System Vote2111[ACTION] Item Upgrade System Vote3111 
Dj Pacos (73)
[ACTION] Item Upgrade System Vote1111[ACTION] Item Upgrade System Vote2111[ACTION] Item Upgrade System Vote3111 
God Skit (68)
[ACTION] Item Upgrade System Vote1111[ACTION] Item Upgrade System Vote2111[ACTION] Item Upgrade System Vote3111 
GoD MexicanSoul (40)
[ACTION] Item Upgrade System Vote1111[ACTION] Item Upgrade System Vote2111[ACTION] Item Upgrade System Vote3111 
fuzzy (35)
[ACTION] Item Upgrade System Vote1111[ACTION] Item Upgrade System Vote2111[ACTION] Item Upgrade System Vote3111 
Eddie (31)
[ACTION] Item Upgrade System Vote1111[ACTION] Item Upgrade System Vote2111[ACTION] Item Upgrade System Vote3111 
GOD Chimito (30)
[ACTION] Item Upgrade System Vote1111[ACTION] Item Upgrade System Vote2111[ACTION] Item Upgrade System Vote3111 
conalep1996 (23)
[ACTION] Item Upgrade System Vote1111[ACTION] Item Upgrade System Vote2111[ACTION] Item Upgrade System Vote3111 

Últimos temas
» [???] [Super Naruto OT]
[ACTION] Item Upgrade System Icon_m10Lun Jun 08, 2015 12:08 pm por keishmer91

» [ACTION] God/GM da item a un player
[ACTION] Item Upgrade System Icon_m10Mar Dic 02, 2014 12:53 pm por hecmanos

» [8.60] Nuevo War Thais By TheRobertxon
[ACTION] Item Upgrade System Icon_m10Vie Jun 20, 2014 10:56 am por luismc

» [7.92]Naruto Final Story!
[ACTION] Item Upgrade System Icon_m10Dom Mayo 26, 2013 2:40 am por ricardotuck

» [9.1] Fun Server
[ACTION] Item Upgrade System Icon_m10Mar Mayo 14, 2013 5:32 pm por skifer

» [9.1] The Forgotten Server v0.2.11pl2 (Mystic Spirit)
[ACTION] Item Upgrade System Icon_m10Mar Mayo 14, 2013 5:29 pm por skifer

» New Map 8.60 (Darksystem) By: Turock & Gilio LIsto Arreglado El
[ACTION] Item Upgrade System Icon_m10Mar Mayo 07, 2013 5:27 pm por tonyso

» Ocean Clasic Global Map 8.6
[ACTION] Item Upgrade System Icon_m10Miér Mayo 01, 2013 11:19 pm por maganiua

» ayuda a abrir puertos
[ACTION] Item Upgrade System Icon_m10Lun Abr 29, 2013 5:58 pm por XxStroksxX

» [8.60] Speedy War
[ACTION] Item Upgrade System Icon_m10Dom Abr 28, 2013 5:51 pm por Sunnade'Audio

Upload Images
ImagesHack
Scanner
VirusTotal

[ACTION] Item Upgrade System

3 participantes

Ir abajo

[ACTION] Item Upgrade System Empty [ACTION] Item Upgrade System

Mensaje por Dj Pacos Lun Mayo 02, 2011 5:59 am

Este script es muy bueno si se usa con el Slot System.

1. Primero deben agregar estas dos lineas en actions.xml :

Código:

<action itemid="8306" event="script" value="upgrade.lua"/>
<action itemid="8305" event="script" value="upgrade.lua"/>

  • La primera linea es para el item 8306 que es el upgrader normal.
  • La segunda es para el item 8305 que es para el upgrader con un chance adicional.

2. Ahora creen "upgrade.lua" y copien dentro lo siguiente :

Código:

-- &a = weapon attack
-- &d = weapon defense
-- &s = shield defense
-- &p = armor defense
-- # = nivel do item
-- @ = max level
local gain = {
gainArmor='&p+(1)',loseArmor='&p-(1)',
gainShield='&s+#',loseShield='&s-(#+1)',
gainAttack='&a+(1*(#))',loseAttack='&a-(1*(#+1))',
gainDefense='&d+(1*(#))',loseDefense='&d-(1*(#+1))',
chance='(100/math.sqrt((((@/4)+(#*2))/@)*#))',
maxlvl = 17,
blocked_ids = {8881}
}
local it = {
--[itemid] = [percent]
[8306] = 0, -- 0% additional
[8305] = 100, -- 50%
}
if not setItemName then
function setItemName(uid,name)
return doItemSetAttribute(uid,'name',name)
end
function setItemArmor(uid,name)
return doItemSetAttribute(uid,'armor',name)
end
function setItemDefense(uid,name)
return doItemSetAttribute(uid,'defense',name)
end
function setItemAttack(uid,name)
return doItemSetAttribute(uid,'attack',name)
end
function getItemAttack(uid)
return getItemAttribute(uid,'attack')
end
function getItemDefense(uid)
return getItemAttribute(uid,'defense')
end
function getItemArmor(uid)
if type(uid) == 'number' then
return getItemAttribute(uid,'armor')
else
return getItemInfo(uid.itemid).armor
end
end
end

local function isArmor(uid) -- Function by Mock the bear.
if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then
return true
end
return false
end
local function isWeapon(uid) -- Function by Mock the bear.
uid = uid or 0
local f = getItemWeaponType(uid)
if f == 1 or f == 2 or f == 3 then
return true
end
return false
end
local function isShield(uid) -- Function by Mock the bear.
uid = uid or 0
if getItemWeaponType(uid) == 4 then
return true
end
return false
end
local function isBow(uid) -- Function by Mock the bear.
uid = uid or 0
if getItemWeaponType(uid) == 5 then
return true
end
return false
end
local function getWeaponLevel(uid) -- Function by Mock the bear.
uid = uid or 0
local name = getItemName(uid.uid) or getItemInfo(uid.itemid).name or ''
local lvl = string.match(name,'%s%+(%d+)%s*')
return tonumber(lvl) or 0
end
local function doTransform(s,i) -- Function by Mock the bear.
local c = string.gsub(s,'@',gain.maxlvl)
local c = string.gsub(c,'&a',(getItemAttack(i.uid) ~= 0 and getItemAttack(i.uid) or getItemInfo(i.itemid).attack))
local c = string.gsub(c,'&d',(getItemDefense(i.uid) ~= 0 and getItemDefense(i.uid) or getItemInfo(i.itemid).defense))
local c = string.gsub(c,'&s',(getItemDefense(i.uid) ~= 0 and getItemDefense(i.uid) or getItemInfo(i.itemid).defense))
local c = string.gsub(c,'&p',(getItemArmor(i.uid) ~= 0 and getItemArmor(i.uid) or getItemInfo(i.itemid).armor))
local c = string.gsub(c,'#',getWeaponLevel(i))
local q = assert(loadstring('return '..c))
return math.floor(assert(q()))
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 0 or item.itemid == 0 then return false end
toPosition.stackpos = 255
if isInArray(gain.blocked_ids, itemEx.itemid)
or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5)
or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx))
or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then
doPlayerSendTextMessage(cid, 24,"You cant refine this item.")
return TRUE
end
if isCreature(itemEx.uid) == TRUE then
return FALSE
end
local level = getWeaponLevel(itemEx)
local chance = doTransform(gain.chance,itemEx)
if level == gain.maxlvl then
doSendMagicEffect(toPosition, 2)
return doPlayerSendTextMessage(cid, 24,"Your item is on max level, you can't upgrade it.")
end
doPlayerSendTextMessage(cid, 24,"Trying refine with "..(chance+it[item.itemid] > 100 and 100 or chance+it[item.itemid]).."% of sucess!")
if chance+it[item.itemid] >= math.random(0,100) then
local nm = getItemName(itemEx.uid)
local slot = nm:match('(%[.+%])') or '' ---If you server use slot system dont change it ^^
slot = slot~='' and ' '..slot or slot
setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level+1)..slot)
addEvent(doPlayerSendTextMessage,500,cid, 24,"Your item has been upgrated to +"..(level+1)..slot..".")
doSendMagicEffect(toPosition, 12)
if isArmor(itemEx) then
local get = doTransform(gain.gainArmor,itemEx)
setItemArmor(itemEx.uid,get)
elseif isBow(itemEx.uid) then
setItemAttack(itemEx.uid, doTransform(gain.gainAttack,itemEx))
elseif isWeapon(itemEx.uid) then
setItemAttack(itemEx.uid, doTransform(gain.gainAttack,itemEx))
setItemDefense(itemEx.uid, doTransform(gain.gainDefense,itemEx))
elseif isShield(itemEx.uid) then
setItemDefense(itemEx.uid, doTransform(gain.gainShield,itemEx))
end
else
if level == 0 then
addEvent(doPlayerSendTextMessage,500,cid, 24,"No effect.")
doSendMagicEffect(toPosition, 2)
elseif level > 0 then
local nm = getItemName(itemEx.uid)
local slot = nm:match('(%[.+%])') or '' ---If you server use slot system dont change it ^^
slot = slot~='' and ' '..slot or slot
if level == 1 then
setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..slot)
addEvent(doPlayerSendTextMessage,500,cid, 24,"Your item back to normal.")
else
setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level-1)..slot)
addEvent(doPlayerSendTextMessage,500,cid, 24,"Your item back to +"..(level-1)..slot..".")
end
if isArmor(itemEx) then
setItemArmor(itemEx.uid,doTransform(gain.loseArmor ,itemEx))
elseif isWeapon(itemEx.uid) then
setItemAttack(itemEx.uid, doTransform(gain.loseAttack,itemEx))
setItemDefense(itemEx.uid, doTransform(gain.loseDefense,itemEx))
elseif isBow(itemEx.uid) then
setItemAttack(itemEx.uid, doTransform(gain.loseAttack,itemEx))
elseif isShield(itemEx.uid) then
setItemDefense(itemEx.uid, doTransform(gain.loseShield,itemEx))
end
end
doSendMagicEffect(toPosition, 9)
end
doRemoveItem(item.uid,1)
return true
end


Y eso seria todo.

Aqui les dejo una imagen :

[ACTION] Item Upgrade System Upu



Espero que les sirva Smile

Creditos :

100% Mock
Dj Pacos
Dj Pacos

Forero fase Beta
Forero fase Beta

Recopilador
Masculino Mexico Pez Serpiente
Safari
Edad Edad : 35
Mensajes Mensajes : 73
Localización Localización : Thais
Fecha de inscripción Fecha de inscripción : 21/04/2011

Volver arriba Ir abajo

[ACTION] Item Upgrade System Empty Re: [ACTION] Item Upgrade System

Mensaje por Famos Lun Mayo 02, 2011 6:28 am

grande tioo! como te doy rep? soy nuevo en el foro
Famos
Famos

Curioso
Curioso

VIP
Masculino Peru Géminis Mono
Firefox
Edad Edad : 31
Mensajes Mensajes : 6
Localización Localización : Famous City
Fecha de inscripción Fecha de inscripción : 02/05/2011

Volver arriba Ir abajo

[ACTION] Item Upgrade System Empty Re: [ACTION] Item Upgrade System

Mensaje por Dj Pacos Lun Mayo 02, 2011 6:35 am

jaja, gracias! siempre aqui para ayudar...

emm.. en la parte superior de la derecha de cada post hay unos botones verde y rojo.. el verde da rep y el rojo quita rep. Smile
Dj Pacos
Dj Pacos

Forero fase Beta
Forero fase Beta

Recopilador
Masculino Mexico Pez Serpiente
Safari
Edad Edad : 35
Mensajes Mensajes : 73
Localización Localización : Thais
Fecha de inscripción Fecha de inscripción : 21/04/2011

Volver arriba Ir abajo

[ACTION] Item Upgrade System Empty Re: [ACTION] Item Upgrade System

Mensaje por Famos Lun Mayo 02, 2011 6:38 am

listooo, ya te di rep!
Famos
Famos

Curioso
Curioso

VIP
Masculino Peru Géminis Mono
Firefox
Edad Edad : 31
Mensajes Mensajes : 6
Localización Localización : Famous City
Fecha de inscripción Fecha de inscripción : 02/05/2011

Volver arriba Ir abajo

[ACTION] Item Upgrade System Empty Re: [ACTION] Item Upgrade System

Mensaje por Dj Pacos Lun Mayo 02, 2011 6:49 am

se agradece la rep Smile

me alegra que seas nuevo en el foro!

Bienvenido!cheers
Dj Pacos
Dj Pacos

Forero fase Beta
Forero fase Beta

Recopilador
Masculino Mexico Pez Serpiente
Safari
Edad Edad : 35
Mensajes Mensajes : 73
Localización Localización : Thais
Fecha de inscripción Fecha de inscripción : 21/04/2011

Volver arriba Ir abajo

[ACTION] Item Upgrade System Empty Re: [ACTION] Item Upgrade System

Mensaje por Glonlova Miér Mayo 04, 2011 10:44 am

muy bueno el post un 1000000000000000000
pero otra cosa donde se pone el lua?
Glonlova
Glonlova

Fisgón
Fisgón

+ New User +
Masculino Mexico Capricornio Perro
Chrome
Edad Edad : 29
Mensajes Mensajes : 10
Localización Localización : Mexico
Fecha de inscripción Fecha de inscripción : 02/05/2011

Volver arriba Ir abajo

[ACTION] Item Upgrade System Empty Re: [ACTION] Item Upgrade System

Mensaje por Dj Pacos Miér Mayo 04, 2011 12:50 pm

el .lua va dentro de data/actions/scripts.
Dj Pacos
Dj Pacos

Forero fase Beta
Forero fase Beta

Recopilador
Masculino Mexico Pez Serpiente
Safari
Edad Edad : 35
Mensajes Mensajes : 73
Localización Localización : Thais
Fecha de inscripción Fecha de inscripción : 21/04/2011

Volver arriba Ir abajo

[ACTION] Item Upgrade System Empty Re: [ACTION] Item Upgrade System

Mensaje por Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.