Hello! I saw a thread started called the X-Mas challenge, and would like to make a contribution!
You can read about how we are using this release in our source:
http://dstroyerms.com/?base=main&page=news&id=20
Onto the release...
Make the following items drop globally at your choice of rate, or give them away during events.
These items can only be held one at a time, so let's edit the WZ image to hold 1000 (feel free to change price and QTY)
Edit: src\trunk\wz\Item.wz\Etc\0400.img (or your wz location)
Add to NPCConversationManager.java
Purple Present NPC:
Red Present NPC:
White Present NPC:
Blue Present NPC:
Enjoy! Will edit post and add pictures later.
You can read about how we are using this release in our source:
http://dstroyerms.com/?base=main&page=news&id=20
Onto the release...
Make the following items drop globally at your choice of rate, or give them away during events.
- 4000422 - White Present
- 4000423 - Red Present
- 4000424 - Blue Present
- 4000425 - Purple Present
These items can only be held one at a time, so let's edit the WZ image to hold 1000 (feel free to change price and QTY)
Edit: src\trunk\wz\Item.wz\Etc\0400.img (or your wz location)
PHP Code:
<imgdir name="04000422">
<imgdir name="info">
<canvas name="icon" width="34" height="33">
<vector name="origin" x="1" y="32"/>
</canvas>
<canvas name="iconRaw" width="34" height="33">
<vector name="origin" x="1" y="31"/>
</canvas>
<int name="price" value="10000"/>
<int name="slotMax" value="1000"/>
</imgdir>
</imgdir>
<imgdir name="04000423">
<imgdir name="info">
<canvas name="icon" width="34" height="33">
<vector name="origin" x="1" y="32"/>
</canvas>
<canvas name="iconRaw" width="34" height="33">
<vector name="origin" x="1" y="32"/>
</canvas>
<int name="price" value="10000"/>
<int name="slotMax" value="1000"/>
</imgdir>
</imgdir>
<imgdir name="04000424">
<imgdir name="info">
<canvas name="icon" width="32" height="31">
<vector name="origin" x="0" y="31"/>
</canvas>
<canvas name="iconRaw" width="32" height="31">
<vector name="origin" x="0" y="31"/>
</canvas>
<int name="price" value="10000"/>
<int name="slotMax" value="1000"/>
</imgdir>
</imgdir>
<imgdir name="04000425">
<imgdir name="info">
<canvas name="icon" width="28" height="30">
<vector name="origin" x="-2" y="30"/>
</canvas>
<canvas name="iconRaw" width="28" height="28">
<vector name="origin" x="-2" y="30"/>
</canvas>
<int name="price" value="10000"/>
<int name="slotMax" value="1000"/>
</imgdir>
</imgdir>
PHP Code:
public void proccessRedP(int[] id) {
gainItem(4000423, (short) -1);
int count = itemQuantity(4000423); //Red Present
int itemid = id[Randomizer.getInstance().nextInt(id.length)];
gainItem(itemid, (short) 1, true);
sendNext("#fUI/UIWindow.img/QuestIcon/4/0# \r\n\r\n #v" + itemid + "# #b#z" + itemid + "##k!");
for(ChannelServer cs : ChannelServer.getAllInstances()) {
cs.broadcastGMPacket(MaplePacketCreator.serverNotice(0, String.format
("%s used Red Present,has %s left! Won: %s %s",
c.getPlayer().getName(), count, getItemName(itemid), c.getSession().getRemoteAddress().toString())));
}
setLog("present", itemid); //call setLog to log present
}
public void proccessBlueP(int[] id) {
gainItem(4000424, (short) -1);
int count = itemQuantity(4000424); //Blue Present
int itemid = id[Randomizer.getInstance().nextInt(id.length)];
gainItem(itemid, (short) 1, true);
sendNext("#fUI/UIWindow.img/QuestIcon/4/0# \r\n\r\n #v" + itemid + "# #b#z" + itemid + "##k!");
for(ChannelServer cs : ChannelServer.getAllInstances()) {
cs.broadcastGMPacket(MaplePacketCreator.serverNotice(0, String.format
("%s used Blue Present,has %s left! Won: %s %s",
c.getPlayer().getName(), count, getItemName(itemid), c.getSession().getRemoteAddress().toString())));
}
setLog("present", itemid); //call setLog to logpresent
}
public void proccessWhiteP(int[] id) {
gainItem(4000422, (short) -1);
int count = itemQuantity(4000422); //White Present
int itemid = id[Randomizer.getInstance().nextInt(id.length)];
gainItem(itemid, (short) 1, true);
sendNext("#fUI/UIWindow.img/QuestIcon/4/0# \r\n\r\n #v" + itemid + "# #b#z" + itemid + "##k!");
for(ChannelServer cs : ChannelServer.getAllInstances()) {
cs.broadcastGMPacket(MaplePacketCreator.serverNotice(0, String.format
("%s used White Present,has %s left! Won: %s %s",
c.getPlayer().getName(), count, getItemName(itemid), c.getSession().getRemoteAddress().toString())));
}
setLog("present", itemid); //call setLog to log present
}
public void proccessPurpleP(int[] id) {
gainItem(4000425, (short) -1);
int count = itemQuantity(4000425); //Purple Present
int itemid = id[Randomizer.getInstance().nextInt(id.length)];
gainItem(itemid, (short) 1, true);
sendNext("#fUI/UIWindow.img/QuestIcon/4/0# \r\n\r\n #v" + itemid + "# #b#z" + itemid + "##k!");
for(ChannelServer cs : ChannelServer.getAllInstances()) {
cs.broadcastGMPacket(MaplePacketCreator.serverNotice(0, String.format
("%s used Purple Present,has %s left! Won: %s %s",
c.getPlayer().getName(), count, getItemName(itemid), c.getSession().getRemoteAddress().toString())));
}
setLog("present", itemid); //call setLog to log present
}
public void processGachapon(int[] id, boolean remote) {
if (!remote) {
gainItem(5220000, (short) -1);
} else {
return;
}
int itemid = id[Randomizer.getInstance().nextInt(id.length)];
gainItem(itemid, (short) 1, true);
sendNext("#fUI/UIWindow.img/QuestIcon/4/0# \r\n\r\n #v" + itemid + "# #b#z" + itemid + "##k!"); //added reward icon
//if (Randomizer.getInstance().nextInt(5) > 3 && gachMaps.containsKey(getNpc())) {
// getClient().getChannelServer().broadcastPacket(MaplePacketCreator.gachaponMessage(getPlayer().getInventory(MapleInventoryType.getByType((byte) (itemid / 1000000))).findById(itemid), c.getPlayer().getMapName(gachMaps.get(getNpc())), getPlayer()));
//}
for(ChannelServer cs : ChannelServer.getAllInstances()) {
cs.broadcastGMPacket(MaplePacketCreator.serverNotice(0, String.format
("%s used Gachapon Ticket,has %s left! Won: %s %s",
c.getPlayer().getName(), itemQuantity(5220000), getItemName(itemid), c.getSession().getRemoteAddress().toString())));
}
setLog("gach", itemid); //call setLog to log gach
}
PHP Code:
/* Revan
* DstroyerMS 70% Scroll Gachapon
* 2001000 - Maple Bucket Snowman
*/
var ids = [4000425, 2040008, 2040012, 2040014, 2040103, 2040108, 2040203, 2040208, 2040304, 2040306, 2040308, 2040404, 2040406, 2040408, 2040410, 2040508, 2040510, 2040518, 2040520, 2040604, 2040606, 2040608, 2040610, 2040712, 2040714, 2040716, 2040808, 2040810, 2040812, 2040814, 2040904, 2040906, 2040908, 2040916, 2040921, 2041026, 2041028, 2041030, 2041032, 2041034, 2041036, 2041038, 2041040, 2043004, 2043006, 2043104, 2043204, 2043304, 2043704, 2043804, 2044004, 2044104, 2044204, 2044304, 2044404, 2044504, 2044604, 2044704];
var status = 0;
var box = 4000425; //Purple box ID
var etc = 1382001; //random etc
var use = 2041002; //random use
var display = "#v" + box + "# #b#z" + box + "##k"; //cool this worked
function start() {
if (cm.haveItem(box)) {
if (cm.canHold(etc) && cm.canHold(use)) {
cm.proccessPurpleP(ids);
cm.dispose();
} else {
cm.sendNext("Please check that you have empty spaces in your inventory.");
cm.dispose();
}
} else if (cm.haveItem(box))
if (cm.canHold(etc) && cm.canHold(use)){
cm.sendYesNo("You may use the Gachapon. Would you like to use your " + display + "?");
} else {
cm.sendNext("Free up some inventory space.");
cm.dispose();
}
else {
cm.sendSimple("Welcome to the #b" + cm.getPlayer().getMap().getMapName() + " 70% Scroll Gachapon#k. How may I help you?\r\n\r\n#L0#What is this?#l\r\n#L1#Where can you get Boxes?#l");
}
}
function action(revan, made, that){
if (revan == 1 && cm.haveItem(box)) {
cm.processGachapon(ids, false);
cm.dispose();
} else {
if (revan > 0) {
status++;
if (that == 0) {
cm.sendNext("Use this NPC to get random 70% scrolls with the use of one " + display + ".");
} else if (that == 1) {
cm.sendOk("You can get boxes either from another player, or by finding them from the monsters!");
cm.dispose();
} else if (status == 2) {
cm.sendOk("All 70% scrolls are available here. If you think some are missing, please tell the Administrator through our forums.");
cm.dispose();
}
}
}
}
PHP Code:
/* By Revan
* DstroyerMS 30% Scroll Gachapon
* 2001002 - Cliff
*/
var ids = [4000423, 2040009, 2040011, 2040013, 2040015, 2040104, 2040109, 2040204, 2040209, 2040305, 2040307, 2040309, 2040405, 2040407, 2040409, 2040411, 2040509, 2040511, 2040519, 2040521, 2040605, 2040607, 2040609, 2040611, 2040713, 2040715, 2040717, 2040809, 2040811, 2040813, 2040815, 2040905, 2040907, 2040909, 2040917, 2040922, 2041027, 2041029, 2041031, 2041033, 2041035, 2041037, 2041039, 2041041, 2043005, 2043007, 2043105, 2043205, 2043305, 2043705, 2043805, 2044005, 2044005, 2044205, 2044305, 2044405, 2044505, 2044605, 2044705];
var status = 0;
var box = 4000423; //Purple box ID
var etc = 1382001; //inventory check
var use = 2041002; //inventory check
var display = "#v" + box + "# #b#z" + box + "##k"; //display
function start() {
if (cm.haveItem(box)) {
if (cm.canHold(etc) && cm.canHold(use)) {
cm.proccessRedP(ids); //gains item, gm message, logs.
cm.dispose();
} else {
cm.sendNext("Please check that you have empty spaces in your inventory.");
cm.dispose();
}
} else if (cm.haveItem(box))
if (cm.canHold(etc) && cm.canHold(use)){
cm.sendYesNo("You may use the Gachapon. Would you like to use your " + display + "?");
} else {
cm.sendNext("Free up some inventory space.");
cm.dispose();
}
else {
cm.sendSimple("Welcome to the #b" + cm.getPlayer().getMap().getMapName() + " 30% Scroll Gachapon#k. How may I help you?\r\n\r\n#L0#What is this?#l\r\n#L1#Where can you get Boxes?#l");
}
}
function action(revan, made, that){
if (revan == 1 && cm.haveItem(box)) {
cm.processGachapon(ids, false);
cm.dispose();
} else {
if (revan > 0) {
status++;
if (that == 0) {
cm.sendNext("Use this NPC to get random 70% scrolls with the use of one " + display + ".");
} else if (that == 1) {
cm.sendOk("You can get boxes either from another player, or by finding them from the monsters!");
cm.dispose();
} else if (status == 2) {
cm.sendOk("All 30% scrolls are available here. If you think some are missing, please tell the Administrator through our forums.");
cm.dispose();
}
}
}
}
PHP Code:
/* Revan
* DstroyerMS 10% Scroll Gachapon
* 9310058 - Santa
*/
var ids = [4000422, 2040602, 2040612, 2040627, 2040622, 2040619, 2044502, 2041020, 2041008, 2041017, 2041023, 2041002, 2041011,
2041014, 2041005, 2044702, 2044602, 2043302, 2040310, 2040318, 2040302, 2040328, 2040331, 2040805, 2040802, 2040825,
2040816, 2044902, 2040016, 2040002, 2040031, 2040005, 2040026, 2044809, 2043102, 2044802, 2043114, 2043102, 2043214,
2043202, 2043019, 2043002, 2043008, 2040505, 2040502, 2040514, 2040517, 2040534, 2048005, 2048002, 2044402, 2041108,
2041105, 2041111, 2041102, 2040902, 2040928, 2040925, 2040920, 2040933, 2040915, 2040760, 2040702, 2040705, 2040708,
2044314, 2043802, 2040402, 2040422, 2040412, 2040419, 2044114, 2044102, 2044214, 2044202, 2044014, 2044002, 2043702];
var status = 0;
var box = 4000422; //White box ID
var etc = 1382001; //inventory check
var use = 2041002; //inventory check
var display = "#v" + box + "# #b#z" + box + "##k"; //display
function start() {
if (cm.haveItem(box)) { //white box ID
if (cm.canHold(etc) && cm.canHold(use)) {
cm.proccessWhiteP(ids);
cm.dispose();
} else {
cm.sendNext("Please check that you have empty spaces in your inventory.");
cm.dispose();
}
} else if (cm.haveItem(box))
if (cm.canHold(etc1) && cm.canHold(use)){
cm.sendYesNo("You may use the Gachapon. Would you like to use your " + display + "?");
} else {
cm.sendNext("Free up some inventory space.");
cm.dispose();
}
else {
cm.sendSimple("Welcome to the #b" + cm.getPlayer().getMap().getMapName() + " 10% Scroll Gachapon#k. How may I help you?\r\n\r\n#L0#What is this?#l\r\n#L1#Where can you get White Boxes?#l");
}
}
function action(revan, made, that){ //this is here for gacha remote, remove later
if (revan == 1 && cm.haveItem(box)) {
cm.processGachapon(ids, false);
cm.dispose();
} else {
if (revan > 0) {
status++;
if (that == 0) {
cm.sendNext("Use this NPC to get random 10% scrolls with the use of one " + display + ".");
} else if (that == 1) {
cm.sendNext("You can get white boxes either from another player, or by finding them from the monsters!.");
cm.dispose();
} else if (status == 2) {
cm.sendNext("All 10% scrolls are available here. If you think some are missing, please tell the Administrator through the forums.");
cm.dispose();
}
}
}
}
PHP Code:
/* By Revan
* DstroyerMS 60% Scroll Gachapon
* 9201033 - Simon
*/
var ids = [4000424, 2049100, 2041307, 2041304, 2041310, 2040601, 2040613, 2040601, 2040625, 2040621, 2040618, 2044501, 2041019, 2041007, 2041016, 2041022, 2041010, 2041013, 2041004, 2044701, 2044601, 2043301, 2040311, 2040317, 2040326, 2040301, 2040321, 2040201, 2040206, 2040106, 2040101, 2040804, 2040826, 2040801, 2040824, 2040817, 2044901, 2040017, 2040029, 2040025, 2044807, 2044801, 2043112, 2043101, 2043212, 2043201, 2043017, 2043001, 2043009, 2040504, 2040501, 2040513, 2040516, 2040532, 2048012, 2048011, 2048004, 2048013, 2048010, 2048010, 2044401, 2044412, 2040901, 2041107, 2041104, 2041110, 2041101, 2040927, 2040924, 2040919, 2040931, 2040914, 2040759, 2040701, 2040704, 2040707, 2044312, 2044301, 2043801, 2040401, 2040421, 2040413, 2040425, 2040418, 2044112, 2044101, 2044212, 2044201, 2044012, 2044001, 2043701];
var status = 0;
var box = 4000424; //Blue box ID
var etc = 1382001; //inventory check
var use = 2041002; //inventory check
var display = "#v" + box + "# #b#z" + box + "##k"; //display
function start() {
if (cm.haveItem(box)) { //Blue box ID
if (cm.canHold(etc) && cm.canHold(use)) {
cm.proccessBlueP(ids);
cm.dispose();
} else {
cm.sendNext("Please check that you have empty spaces in your inventory.");
cm.dispose();
}
} else if (cm.haveItem(box))
if (cm.canHold(etc) && cm.canHold(use)){
cm.sendYesNo("You may use the Gachapon. Would you like to use your " + display + "?");
} else {
cm.sendNext("Free up some inventory space.");
cm.dispose();
}
else {
cm.sendSimple("Welcome to the #b" + cm.getPlayer().getMap().getMapName() + " 60% Scroll Gachapon#k. How may I help you?\r\n\r\n#L0#What is this?#l\r\n#L1#Where can you get Boxes?#l");
}
}
function action(revan, made, that){
if (revan == 1 && cm.haveItem(box)) {
cm.processGachapon(ids, false);
cm.dispose();
} else {
if (revan > 0) {
status++;
if (that == 0) {
cm.sendNext("Use this NPC to get random 60% scrolls with the use of one " + display + ".");
} else if (that == 1) {
cm.sendNext("You can get boxes either from another player, or by finding them from the monsters!");
cm.dispose();
} else if (status == 2) {
cm.sendNext("All 60% scrolls are available here. If you think some are missing, please tell the Administrator through the forums.");
cm.dispose();
}
}
}
}