Ir para conteúdo

Teleport Manager @ Thechaos Style - V0.1a


Posts Recomendados

@The Chaos

Evolutions é uma versão que usa como base CVS ainda.

 

Estava vendo mais de perto o código, e creio que dá para fazer em LUA também, não armazenando em um XML todo organizado, mas, quem for avançado em LUA, pode fazer um XML Reader, é muito fácil e muito útil.

 

sim sim, apesar de eu ser péssimo com lua, da sim ja li algo sobre isso, mas eu penso mais na praticidade pra editar (pra mim é mais pratico xml do que lua) ^^. E também, so carrega quando tem alteração grande, não e carregado a cada teleport pois ja ta na memoria ne, então agiliza ;)

Link para o comentário
Compartilhar em outros sites

É eu vi sabado isso. Tava fuçando a RoadMap ja que eu to bem afastado e conferi.

 

To sem acesso até ao email do msn, onde eu trabalho é bloqueado por proxy, depois mando email com o 'funcional'

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...

ta dando esse erro...

 

../commands.h:84: error: `Teleports' was not declared in this scope

../commands.h:84: error: template argument 2 is invalid

../commands.h:84: error: template argument 4 is invalid

../commands.h:84: error: ISO C++ forbids declaration of `TeleportMap' with no type

 

make.exe: *** [../admin.o] Error 1

 

Execução terminada

 

to usando devland 0.96b..jah tentei no evolutions tbm mesmo erro =/ ajuda ae queria muito usar isso!

Link para o comentário
Compartilhar em outros sites

Tenha certeza de que isso ta no lugar certo no seu commands.h

 

Depois de:

struct s_defcommands{

char *name;

CommandFunc f;

};

 

 

Adicione:

 

struct Teleports{
Position dest;
std::string name;
};

Link para o comentário
Compartilhar em outros sites

//////////////////////////////////////////////////////////////////////

// OpenTibia - an opensource roleplaying game

//////////////////////////////////////////////////////////////////////

//

//////////////////////////////////////////////////////////////////////

// This program is free software; you can redistribute it and/or

// modify it under the terms of the GNU General Public License

// as published by the Free Software Foundation; either version 2

// of the License, or (at your option) any later version.

//

// This program is distributed in the hope that it will be useful,

// but WITHOUT ANY WARRANTY; without even the implied warranty of

// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

// GNU General Public License for more details.

//

// You should have received a copy of the GNU General Public License

// along with this program; if not, write to the Free Software Foundation,

// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

//////////////////////////////////////////////////////////////////////

 

 

#ifndef __OTSERV_COMMANDS_H__

#define __OTSERV_COMMANDS_H__

 

#include <string>

#include <map>

#include "creature.h"

 

class Game;

struct Command;

struct s_defcommands;

 

struct Teleports;

 

class Commands{

public:

Commands():game(NULL),loaded(false){};

Commands(Game* igame);

 

bool loadXml(const std::string& _datadir);

bool isLoaded(){return loaded;}

bool reload();

 

bool exeCommand(Creature* creature, const std::string& cmd);

 

static ReturnValue placeSummon(Creature* creature, const std::string& name);

 

void playerEditCommands(Player* player, Item* item, const std::string& text);

 

bool loadTeleportsXml(const std::string& _datadir);

void reloadTeleports(bool loadxml);

bool saveTeleportXml(const std::string& text);

void redoTeleportMap();

 

protected:

Game* game;

bool loaded;

std::string datadir;

 

//commands

bool placeNpc(Creature* creature, const std::string& cmd, const std::string& param);

bool placeMonster(Creature* creature, const std::string& cmd, const std::string& param);

bool placeSummon(Creature* creature, const std::string& cmd, const std::string& param);

bool broadcastMessage(Creature* creature, const std::string& cmd, const std::string& param);

bool banPlayer(Creature* creature, const std::string& cmd, const std::string& param);

bool teleportMasterPos(Creature* creature, const std::string& cmd, const std::string& param);

bool teleportHere(Creature* creature, const std::string& cmd, const std::string& param);

bool teleportToTown(Creature* creature, const std::string& cmd, const std::string& param);

bool teleportTo(Creature* creature, const std::string& cmd, const std::string& param);

bool createItemById(Creature* creature, const std::string& cmd, const std::string& param);

bool createItemByName(Creature* creature, const std::string& cmd, const std::string& param);

bool subtractMoney(Creature* creature, const std::string& cmd, const std::string& param);

bool reloadInfo(Creature* creature, const std::string& cmd, const std::string& param);

bool testCommand(Creature* creature, const std::string& cmd, const std::string& param);

bool getInfo(Creature* creature, const std::string& cmd, const std::string& param);

bool closeServer(Creature* creature, const std::string& cmd, const std::string& param);

bool openServer(Creature* creature, const std::string& cmd, const std::string& param);

bool onlineList(Creature* creature, const std::string& cmd, const std::string& param);

bool teleportNTiles(Creature* creature, const std::string& cmd, const std::string& param);

bool kickPlayer(Creature* creature, const std::string& cmd, const std::string& param);

//bool exivaPlayer(Creature* creature, const std::string& cmd, const std::string& param);

bool setHouseOwner(Creature* creature, const std::string& cmd, const std::string& param);

bool sellHouse(Creature* creature, const std::string& cmd, const std::string& param);

bool getHouse(Creature* creature, const std::string& cmd, const std::string& param);

bool bansManager(Creature* creature, const std::string& cmd, const std::string& param);

bool serverInfo(Creature* creature, const std::string& cmd, const std::string& param);

bool forceRaid(Creature* creature, const std::string& cmd, const std::string& param);

 

bool setSpeed(Creature* creature, const std::string& cmd, const std::string& param);

bool addDescription(Creature* creature, const std::string& cmd, const std::string& param);

bool outfitChanger(Creature*creature, const std::string& cmd, const std::string& param);

bool commandsXmlEditor(Creature* creature, const std::string& cmd, const std::string& param);

 

bool teleportManager(Creature* creature, const std::string& cmd, const std::string& param);

 

 

 

//table of commands

static s_defcommands defined_commands[];

 

typedef std::map<std::string,Command*> CommandMap;

CommandMap commandMap;

 

typedef std::map<std::string,Teleports*> TeleportMap;

TeleportMap teleportMap;

 

};

 

typedef bool (Commands::*CommandFunc)(Creature*,const std::string&,const std::string&);

 

struct Command{

CommandFunc f;

int32_t accesslevel;

bool loaded;

std::string name;

};

 

struct s_defcommands{

char *name;

CommandFunc f;

};

struct Teleports{

Position dest;

std::string name;

};

 

#endif

 

Esse é o meu commands.h, da uma olhada.

Editado por TheChaos
Link para o comentário
Compartilhar em outros sites

agora deu esse erro

 

../protocol80.cpp: In member function `void Protocol80::parseTextWindow(NetworkMessage&)':

../protocol80.cpp:1258: error: `commands' undeclared (first use this function)

../protocol80.cpp:1258: error: (Each undeclared identifier is reported only once for each function it appears in.)

 

make.exe: *** [../protocol80.o] Error 1

 

Execução terminada

=/
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...