Hi guys,
My first contribution to the Maple Community, altho it's been partly released already. I did write it from scratch with mainly saveToDB and other saving functions as an example.
In MapleGuild.java add these two functions. Anywhere will do.
At the top of the file, look for this:PHP Code:public int getHideout() {
return hideout;
}
public void setHideout(int id) {
this.hideout = id;
}
Add hideout to it:PHP Code:private int id, gp, logo, logoColor, leader, capacity, logoBG, logoBGColor, signature, allianceId;
Now in PlayerCommands.java (or w/e you use as player commands file)PHP Code:private int id, gp, logo, logoColor, leader, capacity, logoBG, logoBGColor, signature, allianceId, hideout;
In MySQL execute this piece of code:PHP Code:} else if (sub[0].equalsIgnoreCase("hideout")) {
if (c.getPlayer().getGuildId() == 0) {
chr.dropMessage("You are currently not in a guild.");
} else {
int guildId = c.getPlayer().getGuildId();
int map = c.getPlayer().getGuild().getHideout();
chr.changeMap(cserv.getMapFactory().getMap(map), cserv.getMapFactory().getMap(map).getPortal(0));
}
} else if (sub[0].equalsIgnoreCase("sethideout")) {
if (c.getPlayer().getGuildId() != 0) {
if (c.getPlayer().getGuildRank() == 1) {
c.getPlayer().getGuild().setHideout(c.getPlayer().getMapId());
chr.dropMessage("You have changed your Guilds Hideout.");
} else {
chr.dropMessage("You are not allowed to change this Guilds Hideout.");
}
} else {
chr.dropMessage("You are currently not in a guild.");
}
Where moopledev is your scheme, u should change it to yours.Code:ALTER TABLE `moopledev`.`guilds` ADD COLUMN `hideout` INT(11) NOT NULL DEFAULT 100000000 AFTER `allianceId`;
100000000 is the default map (I have henesys in case the guild leader didn't set a hideout yet).
and allianceId is just the last column on the table, if you don't have it just scroll all the way right and put whatever is the last one there.
Credits to me for most of the stuff, Kevin for the setHideout function and askHugo explaining to me why it's better to have this in MapleGuild.java .
Hope u guys like it =].

