Tommy Moderators
Number of posts : 38 Registration date : 2008-12-19
| Subject: @hideout command Fri Dec 26, 2008 11:36 am | |
| All credits go to the bburner who released it on valhalla... This is the guild hideout command In Mapleguild.java add - Code:
-
Code: private int hideout; after Code: private int signature; add Code: hideout = rs.getInt("hideout"); after Code: signature = rs.getInt("signature"); add Code: ps = con.prepareStatement("UPDATE hideouts SET guildid = -1 WHERE guildid = ?"); ps.setInt(1, this.id); ps.execute(); ps.close(); after Code: PreparedStatement ps = con.prepareStatement("UPDATE characters SET guildid = 0, guildrank = 5 WHERE guildid = ?"); ps.setInt(1, this.id); ps.execute(); ps.close(); then add this Code: public int getHideout() { return hideout; } In MapleGuildSummary.java - Code:
-
add Code: private int hideout; after Code: private String name; add Code: hideout = g.getHideout(); after Code: name = g.getName(); then add Code: public int getHideout() { return hideout; } replace your savedlocation.java with this
Code: package net.sf.odinms.server.maps;
public enum SavedLocationType { FREE_MARKET, WORLDTOUR, FLORINA, HIDEOUT } and for the command(hideout will only work in chan 1 unless u take that part out playercommands.java - Code:
-
Code: } else if (splitted[0].equals("!hideout")) { if (player.getGuildId() == 0) { mc.dropMessage("You are not in a guild"); } else { MapleGuildSummary g = c.getChannelServer().getGuildSummary(player.getGuildId()); int mapid = g.getHideout(); String guildname = g.getName(); if (mapid == -1) { mc.dropMessage("You guild doesnt have a hideout"); } else if (player.getClient().getChannel() == 1) { if (player.getMapId() != mapid) { player.saveLocation(SavedLocationType.HIDEOUT); MapleMap target = cserv.getMapFactory().getMap(mapid); MaplePortal targetPortal = target.getPortal(0); player.changeMap(target, targetPortal); mc.dropMessage("Welcome to " + guildname + " Hideout"); } else if (player.getMapId() == mapid) { int smap = c.getPlayer().getSavedLocation(SavedLocationType.HIDEOUT); MapleMap target = cserv.getMapFactory().getMap(smap); MaplePortal targetPortal = target.getPortal(0); player.changeMap(target, targetPortal); player.clearSavedLocation(SavedLocationType.HIDEOUT); } } else { mc.dropMessage("Guilds Hideouts are in channel 1"); } } Now For MYSQL Execute this Query - Code:
-
Code: ALTER TABLE `guilds` ADD `hideout` int(11) NOT NULL DEFAULT '-1'; Execute This Query WARNING FOLLOWING QUERY WILL DELETE ALL YOUR SAVED LOCATIONS YOU CAN OPTINALLY EDIT THE VALUE IF U PAY ATTENTION AT THE QUERY YOU SHOULD KNOW WAT TO EDIT - Code:
-
Code: DROP TABLE IF EXISTS `savedlocations`; CREATE TABLE `savedlocations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `characterid` int(11) NOT NULL, `locationtype` enum('FREE_MARKET','WORLDTOUR','FLORINA','HIDEOUT') DEFAULT NULL, `map` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `savedlocations_ibfk_1` (`characterid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=108560 ;
Last edited by Tommy on Sat Dec 27, 2008 9:03 am; edited 1 time in total | |
|
Brandon Server Admins
Number of posts : 14 Age : 30 Location : Texas Registration date : 2008-12-25
| Subject: Re: @hideout command Sat Dec 27, 2008 12:15 am | |
| | |
|
Tommy Moderators
Number of posts : 38 Registration date : 2008-12-19
| Subject: Re: @hideout command Sat Dec 27, 2008 9:00 am | |
| Guild hideouts as you see, you use this command to go to your hideout... | |
|
Donuts Server Admins
Number of posts : 68 Location : SoCal Registration date : 2008-12-25
| Subject: Re: @hideout command Sat Dec 27, 2008 11:38 am | |
| we really don't need guild hideout's yet, we will after, but currently not now, as you see we still have alot of bugs to fix and remove. and input more features. | |
|
Sponsored content
| Subject: Re: @hideout command | |
| |
|