Quantcast
Channel: RaGEZONE - MMO Development Forums
Viewing all articles
Browse latest Browse all 29495

[Release] DstroyerDev Christmas Presents!

$
0
0
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.

  • 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

Add to NPCConversationManager.java

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, (short1true);
        
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(0String.format
                    
("%s used Red Present,has %s left! Won: %s %s",
                    
c.getPlayer().getName(), countgetItemName(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, (short1true);
        
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(0String.format
                    
("%s used Blue Present,has %s left! Won: %s %s",
                    
c.getPlayer().getName(), countgetItemName(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, (short1true);
        
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(0String.format
                    
("%s used White Present,has %s left! Won: %s %s",
                    
c.getPlayer().getName(), countgetItemName(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, (short1true);
        
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(0String.format
                    
("%s used Purple Present,has %s left! Won: %s %s",
                    
c.getPlayer().getName(), countgetItemName(itemid), c.getSession().getRemoteAddress().toString())));
        }
        
setLog("present"itemid); //call setLog to log present
    
}

    public 
void processGachapon(int[] idboolean remote) {
        if (!
remote) {
            
gainItem(5220000, (short) -1);
        } else {
            return;
        }
        
int itemid id[Randomizer.getInstance().nextInt(id.length)];
        
gainItem(itemid, (short1true);
        
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(0String.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    
    


Purple Present NPC:

PHP Code:

/* Revan
 * DstroyerMS 70% Scroll Gachapon
 * 2001000 - Maple Bucket Snowman
*/

var ids = [4000425204000820400122040014204010320401082040203204020820403042040306204030820404042040406204040820404102040508204051020405182040520204060420406062040608204061020407122040714204071620408082040810204081220408142040904204090620409082040916204092120410262041028204103020410322041034204103620410382041040204300420430062043104204320420433042043704204380420440042044104204420420443042044404204450420446042044704];
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(revanmadethat){
    if (
revan == && cm.haveItem(box)) {
        
cm.processGachapon(idsfalse);
        
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();
            }
        }
    }


Red Present NPC:

PHP Code:

/* By Revan
 * DstroyerMS 30% Scroll Gachapon
 * 2001002 - Cliff
*/

var ids = [40004232040009204001120400132040015204010420401092040204204020920403052040307204030920404052040407204040920404112040509204051120405192040521204060520406072040609204061120407132040715204071720408092040811204081320408152040905204090720409092040917204092220410272041029204103120410332041035204103720410392041041204300520430072043105204320520433052043705204380520440052044005204420520443052044405204450520446052044705];
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(revanmadethat){
    if (
revan == && cm.haveItem(box)) {
        
cm.processGachapon(idsfalse);
        
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();
            }
        }
    }


White Present NPC:

PHP Code:

/* Revan
 * DstroyerMS 10% Scroll Gachapon
 * 9310058 - Santa
*/

var ids = [4000422204060220406122040627204062220406192044502204102020410082041017204102320410022041011,
2041014204100520447022044602204330220403102040318204030220403282040331204080520408022040825,
2040816204490220400162040002204003120400052040026204480920431022044802204311420431022043214,
2043202204301920430022043008204050520405022040514204051720405342048005204800220444022041108,
2041105204111120411022040902204092820409252040920204093320409152040760204070220407052040708,
2044314204380220404022040422204041220404192044114204410220442142044202204401420440022043702];
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(revanmadethat){ //this is here for gacha remote, remove later
    
if (revan == && cm.haveItem(box)) {
        
cm.processGachapon(idsfalse);
        
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();
            }
        }
    }


Blue Present NPC:

PHP Code:

/* By Revan
 * DstroyerMS 60% Scroll Gachapon
 * 9201033 - Simon
*/

var ids = [4000424204910020413072041304204131020406012040613204060120406252040621204061820445012041019204100720410162041022204101020410132041004204470120446012043301204031120403172040326204030120403212040201204020620401062040101204080420408262040801204082420408172044901204001720400292040025204480720448012043112204310120432122043201204301720430012043009204050420405012040513204051620405322048012204801120480042048013204801020480102044401204441220409012041107204110420411102041101204092720409242040919204093120409142040759204070120407042040707204431220443012043801204040120404212040413204042520404182044112204410120442122044201204401220440012043701];
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(revanmadethat){
    if (
revan == && cm.haveItem(box)) {
        
cm.processGachapon(idsfalse);
        
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();
            }
        }
    }


Enjoy! Will edit post and add pictures later.

Viewing all articles
Browse latest Browse all 29495

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>