MapleFM

Welcome To The BedTimeStory Forums
 
HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  

Share
 

 @hideout command

Go down 
AuthorMessage
Tommy
Moderators


Number of posts : 38
Registration date : 2008-12-19

@hideout command Empty
PostSubject: @hideout command   @hideout command EmptyFri 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
Back to top Go down
View user profile
Brandon
Server Admins
Brandon

Male Number of posts : 14
Age : 25
Location : Texas
Registration date : 2008-12-25

@hideout command Empty
PostSubject: Re: @hideout command   @hideout command EmptySat Dec 27, 2008 12:15 am

What exactly is this?

_________________
Why do people kill people to show people that killing people is wrong??

------------------------------------
I am the rightful owner of BladeStory!

------------------------------------

Death is only an aspect of life!
@hideout command Angel_of_Death
Back to top Go down
View user profile
Tommy
Moderators


Number of posts : 38
Registration date : 2008-12-19

@hideout command Empty
PostSubject: Re: @hideout command   @hideout command EmptySat Dec 27, 2008 9:00 am

Guild hideouts as you see, you use this command to go to your hideout...
Back to top Go down
View user profile
Donuts
Server Admins
Donuts

Number of posts : 68
Location : SoCal
Registration date : 2008-12-25

@hideout command Empty
PostSubject: Re: @hideout command   @hideout command EmptySat 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.

_________________
@hideout command Banned-1
Mess With Me and You Will End Up Like the Guy.
@hideout command Left4deadbts
Newest Work
@hideout command Donuts
By Me
@hideout command LeftBehind2
By Me
@hideout command DonutsBleachSig
My Signature Store
Back to top Go down
View user profile
Sponsored content




@hideout command Empty
PostSubject: Re: @hideout command   @hideout command Empty

Back to top Go down
 
@hideout command
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
MapleFM :: MapleDream :: MapleDream Chat-
Jump to: