Jump to content

Pandora's Box


Ichigo

Recommended Posts


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  99
  • Reputation:   11
  • Joined:  01/22/13
  • Last Seen:  

Hola a todos. ^_^

 

Este evento esta inspirado en el ultimo evento activo del RO2.

Consiste en ir matando mobs, y estos pueden dropear ciertos items, un tesoro y un martillo, los martillos son necesarios para abrir los tesoros.

+ info

 

 

item_db2
31349,Pandora's_Box,Pandora's Box,3,0,,0,,,,,,,,,,,,,{},{},{}
31350,Pandora's_Mallet,Pandora's Mallet,11,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_Pandora_Box",31350; },{},{}
31351,Pandora's_Key,Pandora's Key,11,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_Pandora_Box",31351; },{},{}
 
idnum2itemdesctable.txt
31349#
Item obtained is base on the items which is used to open the box.
Can be opened by using Pandora's Mallet or Pandora's Keys.
#
31350#
A powerful hammer which can force open the treasure box.
#
31351#
Krafra Items
Key to open Pandora Box.
^CC0000Cannot Destroy.
Sharing among characters in one account is not possible.
Usable to keep at Guild Storage.^000000
#
 
idnum2itemdisplaynametable.txt
31349#Pandora's_Box#
31350#Pandora's_Mallet#
31351#Pandora's_Key#
 

idnum2itemresnametable.txt

 

31349#º¸¹°»óÀÚ_#
31350#ºê¶óµð¿òµ¹¸ÁÄ¡#
31351#½Ã°èž¿­¼è#
 
pandora_box.txt
//============================================
// Pandora's Box
// Creado por Ichigo
// Versión 1.3
//============================================
// item_db2.txt
// 31349,Pandora's_Box,Pandora's Box,3,0,,0,,,,,,,,,,,,,{},{},{}
// 31350,Pandora's_Mallet,Pandora's Mallet,11,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_Pandora_Box",31350; },{},{}
// 31351,Pandora's_Key,Pandora's Key,11,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_Pandora_Box",31351; },{},{}
//============================================
// idnum2itemdesctable.txt
// 31349#
// Item obtained is base on the items which is used to open the box.
// Can be opened by using Pandora's Mallet or Pandora's Keys.
// #
// 31350#
// A powerful hammer which can force open the treasure box.
// #
// 31351#
// Krafra Items
// Key to open Pandora Box.
// ^CC0000Cannot Destroy.
// Sharing among characters in one account is not possible.
// Usable to keep at Guild Storage.^000000
// #
//============================================
// idnum2itemdisplaynametable.txt
// 31349#Pandora's_Box#
// 31350#Pandora's_Mallet#
// 31351#Pandora's_Key#
//============================================
// idnum2itemresnametable.txt
// 31349#º¸¹°»óÀÚ_#
// 31350#ºê¶óµð¿òµ¹¸ÁÄ¡#
// 31351#½Ã°èž¿­¼è#
//============================================
function    script    F_Pandora_Box    {
 
    if(getarg(0) == 31350) {
        set .@i1, 100;
        set .@i2, 25;
    } else {
        set .@i1, 75;
        set .@i2, 0;
    }
        set .@i3, rand(.@i2,.@i1);
    set @nb, query_sql("SELECT item_id FROM  `pandora_db` WHERE tax >= "+.@i3+" and tax <= "+.@i1+" ORDER BY rand() LIMIT 0 , 1;", @item_id);
 
    if(countitem(31349) < 1) {
        dispbottom "Necesitas 1 "+getitemname(31349);
        end;
    }
    delitem getarg(0), 1;
    delitem 31349, 1;
    getitem @item_id, 1;
    end;
}
 
-    script    pandora_box    -1,{
    end;
OnNPCKillEvent:
    // Protección de mobs deviles
    if(BaseLevel < 20) end;
    if(strmobinfo(3,killedrid) < (BaseLevel - 50))    end;
    if(strmobinfo(3,killedrid) > (BaseLevel + 50))    end;
    if(rand(10000) <= 1000)    getitem 31349, 1;    // 10% de posibilidad
    if(rand(10000) <= 100)    getitem 31350, 1;    // 1% de posibilidad
    end;
}
 
//prontera,147,165,4    shop    Kafra#prt_pandora    49,31350:50000
 
En la sql
 
CREATE TABLE IF NOT EXISTS `pandora_db` (
  `item_id` int(11) NOT NULL,
  `tax` int(11) NOT NULL,
  UNIQUE KEY `item_id` (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
INSERT INTO `pandora_db` (`item_id`, `tax`) VALUES
(512, 100),
(521, 100),
(529, 100),
(601, 90),
(602, 70),
(603, 70),
(604, 70),
(605, 70),
(606, 70),
(607, 90),
(608, 95),
(610, 75),
(616, 25),
(656, 50),
(657, 75),
(662, 95),
(670, 75),
(969, 50),
(988, 25),
(989, 25),
(1649, 2),
(1658, 3),
(2111, 20),
(2115, 20),
(2124, 28),
(2125, 30),
(2128, 1),
(2129, 1),
(2147, 30),
(2148, 20),
(2151, 1),
(2153, 20),
(2160, 1),
(2341, 50),
(2342, 25),
(2375, 1),
(2383, 1),
(5390, 10),
(5445, 30),
(6320, 25),
(7230, 25),
(7444, 25),
(7510, 25),
(7875, 25),
(8969, 29),
(12028, 72),
(12031, 77),
(12103, 25),
(12208, 28),
(12210, 25),
(12214, 35),
(12248, 4),
(12278, 26),
(12281, 78),
(12301, 3),
(12302, 3),
(12321, 76),
(12354, 75),
(12575, 49),
(12617, 31),
(14517, 50),
(14518, 50),
(14519, 50),
(14520, 50),
(14527, 70),
(14545, 1),
(15014, 1),
(15023, 25),
(15037, 1),
(15044, 20),
(15046, 28),
(15053, 26),
(15054, 1),
(15056, 20),
(16998, 2),
(19507, 25);

 

pandora_box.txt

Edited by Ichigo
  • Upvote 1
Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  99
  • Reputation:   11
  • Joined:  01/22/13
  • Last Seen:  

Actualizado y testeado, a la versión 1.2.

 

Nota: En la db, cuando más pequeño es la tax, menos posibilidad tiene de salir el item.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  01/31/12
  • Last Seen:  

Love it! <3 Me gustan las pandora del RO2 jaja :D 

Nadamas que termine de ver que ver que items pondré para testearlo y ponerlo 

 

Gracias!~ 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  99
  • Reputation:   11
  • Joined:  01/22/13
  • Last Seen:  

Love it! <3 Me gustan las pandora del RO2 jaja :D

Nadamas que termine de ver que ver que items pondré para testearlo y ponerlo 

 

Gracias!~ 

 

Me alegro que te guste.  :D

 

Actualizado a la versión 1.3

- Actualizadas comprobaciones de nivel, ya que había un pequeño fallo en la comprobación.

- Se ha subido la diferencia de niveles para obtener la Pandora's Box y Pandora's Mallet de 20 a 50.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  258
  • Reputation:   53
  • Joined:  01/09/12
  • Last Seen:  

Gracias por compartir muy buen aporte!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  01/31/12
  • Last Seen:  

Ya lo puse y va excelente :3 

gracias por ponerlo *-* 

 

Solo una pregunta, como funciona lo de la diferencia de niveles? 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  99
  • Reputation:   11
  • Joined:  01/22/13
  • Last Seen:  

Fácil, te explico ...

 

if(BaseLevel < 20) end; --> Si el lv del personaje es menor a 20, no da items.
if(strmobinfo(3,killedrid) < (BaseLevel - 50))    end; --> Si el mob tiene 50 niveles menos que el personaje, no da items.
if(strmobinfo(3,killedrid) > (BaseLevel + 50))    end; --> Si el mob tiene 50 niveles mas que el personaje, no da items.

 

Se podría configurar todo con una simple variable, pero como solo son dos datos, pues no vi necesario hacerlo. ^_^

 

Si te interesa ponerlo con variables, sería así:

-    script    pandora_box    -1,{
    end;
OnNPCKillEvent:
 
    // Configuración
    set .@nin_lv_pj, 20;    // Lv de personaje mínimo para que de items.
    set .@dif_lv_pj, 50;    // Diferencia entre niveles del mob y del personaje para que de items.
    set .@pos_box, 1000;    // % de drop de la Pandora's_Box - 100 = 1%.
    set .@pos_mallet, 100;    // % de drop del Pandora's_Mallet - 100 = 1%.
 
    if(BaseLevel < .@nin_lv_pj) end;
    if(strmobinfo(3,killedrid) < (BaseLevel - .@dif_lv_pj))    end;
    if(strmobinfo(3,killedrid) > (BaseLevel + .@dif_lv_pj))    end;
    if(rand(10000) <= .@pos_box)    getitem 31349, 1;
    if(rand(10000) <= .@pos_mallet)    getitem 31350, 1;
    end;
}
Edited by Ichigo
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  01/31/12
  • Last Seen:  

Solo preguntaba para poder saber como explicarlo ya que no entendia bien eso de los niveles, pero esta perfecto. 

 

Gracias c: !!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...