Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //After
- enum playerinfo_t {
- //Add this
- PLAYERINFO_LEVEL,
- //After
- #define PLAYER_MIN_SPEED 10
- //Add this
- struct PlayerCast //Cast System Felipe MOnteiro
- {
- uint16_t curId;
- uint16_t specId;
- bool isCasting;
- std::string password;
- int mCastChannelId;
- PlayerCast() {
- mCastChannelId = -1;
- isCasting = false;
- curId = 1;
- specId = 1;
- password = "";
- }
- };
- template <class T> //Cast System Felipe Monteiro
- class AutoList : public std::map<uint32_t, T*> //Cast System Felipe Monteiro
- {
- };
- //After
- class Player : public Creature, public Cylinder
- {
- //Add this
- public:
- AutoList<ProtocolGame> cSpectators;
- uint32_t nextSpectator;
- PlayerCast cast;
- bool getCastingState() const;
- void setCasting(bool castStatus);
- virtual const std::string& getCastingPassword(){
- return cast.password;
- }
- PlayerCast getCast();
- void setCastPassword(std::string password_);
- void addCastViewer(ProtocolGame* pg);
- void removeCastViewer(uint32_t id);
- uint32_t getCastIpByName(std::string n);
- uint32_t getCastViewerCount() const;
- void kickCastViewers();
- bool kickCastViewerByName(std::string n);
- //After
- void sendFYIBox(const std::string& message) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendFYIBox(message);
- //After
- void sendCreatureSkull(const Creature* creature) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureSkull(creature);
- //After
- void sendAddTileItem(const Tile* tile, const Position& pos, const Item* item) {
- //Add this
- for (auto it : cSpectators){
- int32_t stackpos = tile->getStackposOfThing(this, item);
- if (stackpos != -1) {
- it.second->sendAddTileItem(pos, stackpos, item);
- }
- }
- //After
- void sendUpdateTileItem(const Tile* tile, const Position& pos, const Item* item) {
- //Add this
- for (auto it : cSpectators){
- int32_t stackpos = tile->getStackposOfThing(this, item);
- if (stackpos != -1) {
- it.second->sendUpdateTileItem(pos, stackpos, item);
- }
- }
- //After
- void sendRemoveTileThing(const Position& pos, int32_t stackpos) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendRemoveTileThing(pos, stackpos);
- //After
- void sendUpdateTile(const Tile* tile, const Position& pos) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendUpdateTile(tile, pos);
- //After
- void sendChannelMessage(const std::string& author, const std::string& text, SpeakClasses type, uint16_t channel) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendChannelMessage(author, text, type, channel);
- //After
- void sendChannelEvent(uint16_t channelId, const std::string& playerName, ChannelEvent_t channelEvent) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendChannelEvent(channelId, playerName, channelEvent);
- //After
- void sendCreatureAppear(const Creature* creature, const Position& pos, bool isLogin) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendAddCreature(creature, pos, creature->getTile()->getStackposOfCreature(this, creature), isLogin);
- //After
- void sendCreatureMove(const Creature* creature, const Position& newPos, int32_t newStackPos, const Position& oldPos, int32_t oldStackPos, bool teleport) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendMoveCreature(creature, newPos, newStackPos, oldPos, oldStackPos, teleport);
- //After
- void sendCreatureTurn(const Creature* creature) {
- //Add this
- for (auto it : cSpectators) { //Cast System Felipe Monteiro
- int32_t stackpos = creature->getTile()->getStackposOfCreature(this, creature);
- if (stackpos != -1) {
- it.second->sendCreatureTurn(creature, stackpos);
- }
- }
- //After
- void sendCreatureSay(const Creature* creature, SpeakClasses type, const std::string& text, const Position* pos = nullptr) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureSay(creature, type, text, pos);
- //After
- void sendPrivateMessage(const Player* speaker, SpeakClasses type, const std::string& text) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendPrivateMessage(speaker, type, text);
- //After
- void sendCreatureSquare(const Creature* creature, SquareColor_t color) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureSquare(creature, color);
- //After
- void sendCreatureChangeOutfit(const Creature* creature, const Outfit_t& outfit) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureOutfit(creature, outfit);
- //After
- if (creature->getPlayer()) {
- if (visible) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureOutfit(creature, creature->getCurrentOutfit());
- //After
- static Outfit_t outfit;
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureOutfit(creature, outfit);
- //After
- } else if (canSeeInvisibility()) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureOutfit(creature, creature->getCurrentOutfit());
- //Before
- client->sendAddCreature(creature, creature->getPosition(), stackpos, false);
- //Add this
- for (auto it : cSpectators)
- it.second->sendAddCreature(creature, creature->getPosition(), stackpos, false);
- //Before
- client->sendRemoveTileThing(creature->getPosition(), stackpos);
- //Add this
- for (auto it : cSpectators)
- it.second->sendRemoveTileThing(creature->getPosition(), stackpos);
- //After
- void sendCreatureLight(const Creature* creature) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureLight(creature);
- //After
- void sendCreatureWalkthrough(const Creature* creature, bool walkthrough) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureWalkthrough(creature, walkthrough);
- //After
- void sendCreatureShield(const Creature* creature) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureShield(creature);
- //After
- void sendCreatureType(uint32_t creatureId, uint8_t creatureType) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureType(creatureId, creatureType);
- //After
- void sendCreatureHelpers(uint32_t creatureId, uint16_t helpers) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureHelpers(creatureId, helpers);
- //After
- void sendSpellCooldown(uint8_t spellId, uint32_t time) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendSpellCooldown(spellId, time);
- //After
- void sendSpellGroupCooldown(SpellGroup_t groupId, uint32_t time) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendSpellGroupCooldown(groupId, time);
- //After
- void sendDamageMessage(MessageClasses mclass, const std::string& message, const Position& pos,
- uint32_t primaryDamage = 0, TextColor_t primaryColor = TEXTCOLOR_NONE,
- uint32_t secondaryDamage = 0, TextColor_t secondaryColor = TEXTCOLOR_NONE) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendDamageMessage(mclass, message, pos, primaryDamage, primaryColor, secondaryDamage, secondaryColor);
- //After
- void sendHealMessage(MessageClasses mclass, const std::string& message, const Position& pos, uint32_t heal, TextColor_t color) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendHealMessage(mclass, message, pos, heal, color);
- //After
- void sendExperienceMessage(MessageClasses mclass, const std::string& message, const Position& pos, uint32_t exp, TextColor_t color) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendExperienceMessage(mclass, message, pos, exp, color);
- //After
- void sendContainer(uint8_t cid, const Container* container, bool hasParent, uint16_t firstIndex) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendContainer(cid, container, hasParent, firstIndex);
- //After
- void sendInventoryItem(slots_t slot, const Item* item) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendInventoryItem(slot, item);
- //After
- void sendCancel(const std::string& msg) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendTextMessage(MESSAGE_STATUS_SMALL, msg);
- //After
- void sendCancelTarget() const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCancelTarget();
- //After
- void sendCancelWalk() const {
- //Add this
- for (auto it : cSpectators) //Cast System Felipe Monteiro
- it.second->sendCancelWalk();
- //After
- void sendChangeSpeed(const Creature* creature, uint32_t newSpeed) const {
- /Add this
- for (auto it : cSpectators)
- it.second->sendChangeSpeed(creature, newSpeed);
- //After
- void sendCreatureHealth(const Creature* creature) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatureHealth(creature);
- //After
- void sendDistanceShoot(const Position& from, const Position& to, unsigned char type) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendDistanceShoot(from, to, type);
- //After
- void sendCreatePrivateChannel(uint16_t channelId, const std::string& channelName) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCreatePrivateChannel(channelId, channelName);
- //After
- void sendIcons() const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendIcons(getClientIcons());
- //After
- void sendMagicEffect(const Position& pos, uint8_t type) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendMagicEffect(pos, type);
- //After
- void sendPingBack() const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendPingBack();
- //After
- void sendBasicData() const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendBasicData();
- //After
- void sendSkills() const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendSkills();
- //After
- void sendTextMessage(MessageClasses mclass, const std::string& message, Position* pos = nullptr, uint32_t value = 0, TextColor_t color = TEXTCOLOR_NONE) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendTextMessage(mclass, message, pos, value, color);
- //After
- void sendTextMessage(const TextMessage& message) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendTextMessage(message);
- //After
- void sendReLoginWindow(uint8_t unfairFightReduction) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendReLoginWindow(unfairFightReduction);
- //After
- void sendTextWindow(Item* item, uint16_t maxlen, bool canWrite) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendTextWindow(windowTextId, item, maxlen, canWrite);
- //After
- void sendTextWindow(uint32_t itemId, const std::string& text) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendTextWindow(windowTextId, itemId, text);
- //After
- if (client) {
- client->sendTextWindow(windowTextId, itemId, text);
- }
- }
- //Add this
- void sendToChannel(ProtocolGame* from, const std::string& text) {
- for (auto it : cSpectators)
- it.second->sendToChannel(from, text);
- if (client)
- client->sendToChannel(from, text);
- }
- //After
- void sendToChannel(const Creature* creature, SpeakClasses type, const std::string& text, uint16_t channelId) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendToChannel(creature, type, text, channelId);
- //After
- void sendShop(Npc* npc) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendShop(npc, shopItemList);
- //After
- void sendSaleItemList() const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendSaleItemList(shopItemList);
- //After
- void sendCloseShop() const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCloseShop();
- //After
- void sendMarketEnter(uint32_t depotId) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendMarketEnter(depotId);
- //After
- void sendMarketLeave() {
- inMarket = false;
- //Add this
- for (auto it : cSpectators)
- it.second->sendMarketLeave();
- //After
- void sendMarketBrowseItem(uint16_t itemId, const MarketOfferList& buyOffers, const MarketOfferList& sellOffers) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendMarketBrowseItem(itemId, buyOffers, sellOffers);
- //After
- void sendMarketBrowseOwnOffers(const MarketOfferList& buyOffers, const MarketOfferList& sellOffers) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendMarketBrowseOwnOffers(buyOffers, sellOffers);
- //After
- void sendMarketBrowseOwnHistory(const HistoryMarketOfferList& buyOffers, const HistoryMarketOfferList& sellOffers) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendMarketBrowseOwnHistory(buyOffers, sellOffers);
- //After
- void sendMarketDetail(uint16_t itemId) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendMarketDetail(itemId);
- //After
- void sendMarketAcceptOffer(const MarketOfferEx& offer) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendMarketAcceptOffer(offer);
- //After
- void sendMarketCancelOffer(const MarketOfferEx& offer) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendMarketCancelOffer(offer);
- //After
- void sendTradeItemRequest(const Player* player, const Item* item, bool ack) const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendTradeItemRequest(player, item, ack);
- //After
- void sendTradeClose() const {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCloseTrade();
- //After
- void sendWorldLight(const LightInfo& lightInfo) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendWorldLight(lightInfo);
- //After
- void sendChannelsDialog() {
- //Add this
- for (auto it : cSpectators)
- it.second->sendChannelsDialog();
- //After
- void sendOpenPrivateChannel(const std::string& receiver) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendOpenPrivateChannel(receiver);
- //After
- void sendOutfitWindow() {
- //Add this
- for (auto it : cSpectators)
- it.second->sendOutfitWindow();
- //After
- void sendCloseContainer(uint8_t cid) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendCloseContainer(cid);
- //After
- void sendChannel(uint16_t channelId, const std::string& channelName, const UsersMap* channelUsers, const InvitedMap* invitedUsers) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendChannel(channelId, channelName, channelUsers, invitedUsers);
- //After
- void sendTutorial(uint8_t tutorialId) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendTutorial(tutorialId);
- //After
- void sendAddMarker(const Position& pos, uint8_t markType, const std::string& desc) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendAddMarker(pos, markType, desc);
- //After
- void sendQuestLog() {
- //Add this
- for (auto it : cSpectators)
- it.second->sendQuestLog();
- //After
- void sendQuestLine(const Quest* quest) {
- //Add this
- for (auto it : cSpectators)
- it.second->sendQuestLine(quest);
- //After
- void sendEnterWorld() {
- //Add this
- for (auto it : cSpectators)
- it.second->sendEnterWorld();
- //After
- void sendFightModes() {
- //Add this
- for (auto it : cSpectators)
- it.second->sendFightModes();
- //After
- void sendNetworkMessage(const NetworkMessage& message) {
- //Add this
- for (auto it : cSpectators)
- it.second->writeToOutputBuffer(message);
Advertisement
Add Comment
Please, Sign In to add comment