Magic Guard

Status
Not open for further replies.
Re: [Release] Magic Guard

RE: Pro-Surf: Read posts 9/10.
RE: klyster:

Re: [Release] Magic Guard - Today, 07:03 PM
om confused... it is meso guard or magic guard? xD

Copied and pasted directly from your post. Don't see where the confusion comes in. :[
 
Re: [Release] Magic Guard

well i got the 4a...

but 1c .... i dont know what u mean whit the 'Player Constructor'

and i dont know were is that! >.<!

can say plz?
 
Re: [Release] Magic Guard

If done improperly your character will be bugged like the one MrKisahn is talking about. Too much HP+MP bar goes wild
 
Re: [Release] Magic Guard

Well, I just added this and the skill works fine, however after adding it my NPCs no longer function, what would cause this to happen?
 
Re: [Release] Magic Guard

klyster: It's basic C++ syntax. - scroll down to Constructors and Destructors. I also showed the entire constructor function in code after that directive. Should be pretty easy to spot. o_O

Krytical: Not...quite. His members were setting their HP/MP values above 32767, causing them to go negative and glitch. This has nothing to do with that. :/

Zibblerah: Only thing I can think of is you had some custom NPC code somewhere that was replaced. There's really nothing in the changed code that would mess with NPCs, unless Maps.cpp somehow was affected by it. Perhaps you can provide more detail?
 
Re: [Release] Magic Guard

Hmm i dont know if anyone else got this error but well ima post since it the first time i got this error kinda weird XD so here it is:

MapleStoryServer.cpp
.\MapleStoryServer.cpp(39) : error C2259: 'PlayerFactory' : cannot instantiate abstract class
due to following members:
'AbstractPlayer *AbstractPlayerFactory::createPlayer(void)' : is abstract
c:\documents and settings\manuel\bureau\nouveau dossier\maplestoryserver\../Connection/AbstractPlayer.h(18) : see declaration of 'AbstractPlayerFactory::createPlayer'
 
Re: [Release] Magic Guard

ok, i find the player constructor, but now i dont know were the code go...

can say me? or other tip.... xD
 
Re: [Release] Magic Guard

Err. klyster, you only have to add magicguard=false; to the constructor. That's it.

Regarding the odd error, I doubt that was caused by adding this. I didn't specify any changes to MapleStoryServer.cpp or AbstractPlayer.h/.cpp. In either case, I can probably point you in the proper direction if you post your MapleStoryServer.cpp in code tags.
 
Re: [Release] Magic Guard

Sure, well for NPCs I'm using toxicwinds 62shops (only changed to take out a few items) and his all teleportersV3(only changed to use zeros GMS like taxis and another persons Shanks (i forget the person lol) . I'm using Rieyhns 1st-3rd job NPCs (changed so they actually give the 1 SP at your 1st job advance). ccoffees pap/zak and jojipos horntail. I agree that to my knowledge it shouldn't mess with my NPCs, however I can't deny the fact this it IS this skill (I always add things one by one so I can know where I messed up lol)

If theres any more information that perhaps you might find more useful please let me know
 
Re: [Release] Magic Guard

Well here is my maple story server.cpp and here is my abstractplayer.h

#include "../Connection/Acceptor.h"
#include "PlayerLogin.h"
#include "Player.h"
#include "MySQLM.h"
#include <stdlib.h>
#include "Initializing.h"
#include "Timer.h"
#include "Skills.h"
#include "Maps.h"
#include "Server.h"
#include "ShipEvent.h"
#include <time.h>
void main(){
Initializing::initializing();
printf("Initializing Timers... ");
Timer::timer = new Timer();
Skills::startTimer();
Maps::startTimer();
printf("DONE\n");
printf("Initializing MySQL... ");
if(MySQL::connectToMySQL())
printf("DONE\n");
else{
printf("FAILED\n");
exit(1);
}
Server::initialize();
WSADATA wsaData;
int iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
if (iResult != NO_ERROR) printf("Error at WSAStartup()\n");
srand((unsigned char)time(0));
Selector* selector = new Selector();
Acceptor::Acceptor(8484, selector, new PlayerLoginFactory());
for(int i=0; i<5; i++){
Acceptor::Acceptor(8888+i, selector, new PlayerFactory());
}
while(getchar()){}
}





#ifndef ABSTRACTPLAYER_H
#define ABSTRACTPLAYER_H
class PacketHandler;
class AbstractPlayer {
public:
virtual void setPacketHandler (PacketHandler* packetHandler) {
this->packetHandler = packetHandler;
}
virtual void handleRequest (unsigned char* buf, int len) = 0;
virtual ~AbstractPlayer(){}
protected:
PacketHandler* packetHandler;
};
class AbstractPlayerFactory {
public:
virtual AbstractPlayer* createPlayer () = 0;
};
#endif



BTW i dont know why but when i add mg i got the error and when i remove i can play o.o
 
Re: [Release] Magic Guard

Zibblerah: Do any of those modify Player.h, Skills.cpp, Players.cpp, or Maps.cpp? More specifically, I suspect the moveMap() function to be the cause, because it calls changeMap() which calls newMap() which loads the NPC data.

xfloflox: Those are perfectly fine, I'm guessing it has something to do with Player.h. Let me know the result. You might've done something funny to the Player::Player() constructor, I think.
 
Re: [Release] Magic Guard

This is my player constructor

Player () {
isconnect=0;
shop=0;
npc=NULL;
chair=0;
magicguard=false;
}

is it right? o.O


hmm and here my player.h sorry for taking osmuch of your time >.< normaly i can fix my error :(


#ifndef PLAYER_H
#define PLAYER_H

#include "../Connection/AbstractPlayer.h"
#include "../Connection/PacketHandler.h"
#include "PlayerInventory.h"
#include <string.h>
#include <math.h>

struct Pos {
short x;
short y;
};

class NPC;
class PlayerSkills;
class PlayerQuests;

int distPos(Pos pos1, Pos pos2);

class Player:public AbstractPlayer {
public:

bool getMG() {
return magicguard;
}
void setMG(bool magicguard) {
this->magicguard = magicguard;
}
Player () {
isconnect=0;
shop=0;
npc=NULL;
chair=0;
magicguard=false;
}
~Player();
void save();
void handleRequest(unsigned char* buf, int len);
void sendPacket(unsigned char* buf, int len){ packetHandler->sendPacket(buf,len); }
void setPlayerid(int id){
this->id = id;
}
int getPlayerid(){
return this->id;
}
char* getName(){
return this->name;
}
char getGender(){
return this->gender;
}
void setSkin(char id);
char getSkin(){
return this->skin;
}
void setEyes(int id);
int getEyes(){
return this->eyes;
}
void setHair(int id);
int getHair(){
return this->hair;
}
void setCombo(int combo){ // Combo Attack
this->combo = combo;
}
int getCombo(){ // Combo Attack
return combo;
}
void setLevel(int level);
unsigned char getLevel(){
return this->level;
}
void setJob(short job);
short getJob(){
return this->job;
}
void setStr(short str){
this->str=str;
}
short getStr(){
return this->str;
}
void setDex(short dex){
this->dex=dex;
}
short getDex(){
return this->dex;
}
void setInt(short intt){
this->intt=intt;
}
short getInt(){
return this->intt;
}
void setLuk(short luk){
this->luk=luk;
}
short getLuk(){
return this->luk;
}
void setHP(int hp, bool is=1);
unsigned short getHP(){
return this->hp;
}
void setMP(int mp, bool is=0);
unsigned short getMP(){
return this->mp;
}
void setMHP(int mhp){
this->mhp=mhp;
}
unsigned short getMHP(){
return this->mhp;
}
void setMMP(int mmp){
this->mmp=mmp;
}
unsigned short getMMP(){
return this->mmp;
}
void setAp(short ap){
this->ap=ap;
}
short getAp(){
return this->ap;
}
void setSp(short sp);
short getSp(){
return this->sp;
}
void setFame(short fame){
this->fame=fame;
}
short getFame(){
return this->fame;
}
void setExp(int exp, bool is);
int getExp(){
return this->exp;
}
void setMap(int map){
this->map=map;
}
int getMap(){
return this->map;
}
void setOrigin(){
this->origin=this->map;
}
int getOrigin(){
return this->origin;
}
void setMappos(char pos){
this->mappos = pos;
}
char getMappos(){
return this->mappos;
}
Pos getPos(){
return this->pos;
}
void setPos(Pos pos){
this->pos = pos;
}
void setType(char type){
this->type=type;
}
char getType(){
return this->type;
}
void setShop(int shopid){
shop=shopid;
}
int getShop(){
return shop;
}
void setNPC(NPC* npc){
this->npc = npc;
}
void setChair(int chair){
this->chair = chair;
}
int getChair(){
return chair;
}
NPC* getNPC(){
return npc;
}
int isGM(){
return gm;
}
PlayerInventory* inv;
PlayerSkills* skills;
PlayerQuests* quests;
private:
bool isconnect;
bool magicguard;
int id;
char name[15];
char gender;
char skin;
int eyes;
int hair;
unsigned char level;
short job;
short str;
short dex;
short intt;
short luk;
unsigned short hp;
unsigned short mhp;
unsigned short mp;
unsigned short mmp;
short ap;
short sp;
int exp;
short fame;
int map;
int origin;
char mappos;
char type;
int keys[90];
int shop;
int chair;
int gm;
int combo; // Combo Attack
Pos pos;
NPC* npc;
void getUserID(unsigned char* buf){
isconnect=1;
setPlayerid(buf[0] + buf[1]*0x100 + buf[2]*0x100*0x100 + buf[3]*0x100*0x100*0x100);
playerConnect();
}
void playerConnect();
void chaneKey(unsigned char* packet);
};

class PlayerFactory:public AbstractPlayerFactory {
public:
AbstractPlayer* createPlayer() {
return new Player();
}
};

#endif

is it normal ?
 
Re: [Release] Magic Guard

I dont know but i think it has to do with the last part in the player.h dunno im not realy good at coding sorry again.

Hmm dunno but could it be because of there is no #include "Player.h" in the abstractplayer.h?

just thinking XD well im thinking that since of this

#include "../Connection/AbstractPlayer.h" in the player.h file O.O
 
Re: [Release] Magic Guard

Code:
#ifndef PLAYER_H
#define PLAYER_H
 
#include "../Connection/AbstractPlayer.h"
#include "../Connection/PacketHandler.h"
#include "PlayerInventory.h"
#include <string.h>
#include <math.h>
 
struct Pos {
    short x;
    short y;
};
 
class NPC;
class PlayerSkills;
class PlayerQuests;
 
int distPos(Pos pos1, Pos pos2);
 
class Player:public AbstractPlayer {
public:
 
        bool getMG() {
        return magicguard;
        }
        void setMG(bool magicguard) {
        this->magicguard = magicguard;
        }  
    Player () {
        isconnect=0;
        shop=0;
        npc=NULL;
        chair=0;
        magicguard=false;
    }
    ~Player();
    void save();
    void handleRequest(unsigned char* buf, int len);
    void sendPacket(unsigned char* buf, int len){ packetHandler->sendPacket(buf,len); }
    void setPlayerid(int id){
        this->id = id;
    }
    int getPlayerid(){
        return this->id;
    }
    char* getName(){
        return this->name;
    }
    char getGender(){
        return this->gender;
    }
    void setSkin(char id);
    char getSkin(){
        return this->skin;
    }
    void setEyes(int id);
    int getEyes(){
        return this->eyes;
    }
    void setHair(int id);
    int getHair(){
        return this->hair;
    }
    void setCombo(int combo){ // Combo Attack
        this->combo = combo;
        }
        int getCombo(){ // Combo Attack
        return combo;
        }  
    void setLevel(int level);
    unsigned char getLevel(){
        return this->level;
    }
    void setJob(short job);
    short getJob(){
        return this->job;
    }
    void setStr(short str){
        this->str=str;
    }
    short getStr(){
        return this->str;
    }
    void setDex(short dex){
        this->dex=dex;
    }
    short getDex(){
        return this->dex;
    }
    void setInt(short intt){
        this->intt=intt;
    }
    short getInt(){
        return this->intt;
    }
    void setLuk(short luk){
        this->luk=luk;
    }
    short getLuk(){
        return this->luk;
    }
    void setHP(int hp, bool is=1);
    unsigned short getHP(){
        return this->hp;
    }
    void setMP(int mp, bool is=0);
    unsigned short getMP(){
        return this->mp;
    }
    void setMHP(int mhp){
        this->mhp=mhp;
    }
    unsigned short getMHP(){
        return this->mhp;
    }
    void setMMP(int mmp){
        this->mmp=mmp;
    }
    unsigned short getMMP(){
        return this->mmp;
    }
    void setAp(short ap){
        this->ap=ap;
    }
    short getAp(){
        return this->ap;
    }
    void setSp(short sp);
    short getSp(){
        return this->sp;
    }
    void setFame(short fame){
        this->fame=fame;
    }
    short getFame(){
        return this->fame;
    }
    void setExp(int exp, bool is);
    int getExp(){
        return this->exp;
    }
    void setMap(int map){
        this->map=map;
    }
    int getMap(){
        return this->map;
    }
        void setOrigin(){
        this->origin=this->map;
    }
    int getOrigin(){
        return this->origin;
    }
    void setMappos(char pos){
        this->mappos = pos;
    }
    char getMappos(){
        return this->mappos;
    }
    Pos getPos(){
        return this->pos;
    }
    void setPos(Pos pos){
        this->pos = pos;
    }
    void setType(char type){
        this->type=type;
    }
    char getType(){
        return this->type;
    }
    void setShop(int shopid){
        shop=shopid;
    }
    int getShop(){
        return shop;
    }
    void setNPC(NPC* npc){
        this->npc = npc;
    }
    void setChair(int chair){
        this->chair = chair;
    }
    int getChair(){
        return chair;
    }
    NPC* getNPC(){
        return npc;
    }
    int isGM(){
        return gm;
    }
    PlayerInventory* inv;
    PlayerSkills* skills;
    PlayerQuests* quests;
private:    
    bool isconnect;
    bool magicguard;  
    int id;
    char name[15];
    char gender;
    char skin;
    int eyes;
    int hair;
    unsigned char level;
    short job;
    short str;
    short dex;
    short intt;
    short luk;
    unsigned short hp;
    unsigned short mhp;
    unsigned short mp;
    unsigned short mmp;
    short ap;
    short sp;
    int exp;
    short fame;
    int map;
    int origin;
    char mappos;
    char type;
    int keys[90];
    int shop;
    int chair;
    int gm;
    int combo; // Combo Attack 
    Pos pos;
    NPC* npc;
    void getUserID(unsigned char* buf){
        isconnect=1;
        setPlayerid(buf[0] + buf[1]*0x100 + buf[2]*0x100*0x100 + buf[3]*0x100*0x100*0x100);
        playerConnect();
    }
    void playerConnect();
    void chaneKey(unsigned char* packet);
};
 
class PlayerFactory:public AbstractPlayerFactory {
public:
    AbstractPlayer* createPlayer() {
        return new Player();
    }
};
 
#endif

like this? o.O and sorry for that Razzen ,didn't mean to offence anyone.
 
Status
Not open for further replies.
Back