Jump to content

Herlp : My .patch


Guest Raxine

Recommended Posts

Ello i have create a .patch for 2.4.3 =>3.0.3 dont work to 3.0.8 Why ?

What is my error ?

+bool ChatHandler::HandleBoutique(const char *args) {

+

+ Player *player = m_session->GetPlayer();

+

+ // si aucun argument renvoie à l'aide

+ if (!*args)

+ {

+ SendSysMessage(LANG_BOUTIQUE_HELP);

+ return true;

+ }

This is the error after compilation

if

g++ -DHAVE_CONFIG_H -I. -I../../../src/game -I../.. -I/usr/include/mysql -I. ./../../dep/ACE_wrappers -I../../dep/ACE_wrappers -I../../src/shared -I../../.. /src/game -I../../../src/game/../../dep/include -I../../../src/game/../framework -I../../../src/game/../shared -I../../../src/game/../shared/vmap -I../../../src /game/../realmd -DSYSCONFDIR=\\"/home/MaNGOS/server/etc/\\" -DENABLE_RA -DENABLE _CLI -DDO_MYSQL -g -O2 -MT Level0.o -MD -MP -MF ".deps/Level0.Tpo" -c -o Level0. o ../../../src/game/Level0.cpp; \\

then mv -f ".deps/Level0.Tpo" ".deps/Level0.Po"; else rm -f ".deps/Level 0.Tpo"; exit 1; fi

../../../src/game/Level0.cpp:505:2: warning: no newline at end of file

../../../src/game/Level0.cpp: In member function 'bool ChatHandler::HandleBoutiq ue(const char*)':

../../../src/game/Level0.cpp:440: error: no matching function for call to 'Playe r::learnSpell(uint32&wink.gif'

../../../src/game/Player.h:1442: note: candidates are: void Player::learnSpell(u int32, bool)

make[3]: *** [Level0.o] Erreur 1

make[3]: quittant le répertoire « /home/MaNGOS/sources/mangos/objdir/src/game »

make[2]: *** [all-recursive] Erreur 1

make[2]: quittant le répertoire « /home/MaNGOS/sources/mangos/objdir/src »

make[1]: *** [all-recursive] Erreur 1

make[1]: quittant le répertoire « /home/MaNGOS/sources/mangos/objdir »

make: *** [all] Erreur 2

Sry bad english i'm french .

Thx for help me

Link to comment
Share on other sites

This is the full .patch for item recuparation in game.

Whats is the probleme

/*-----------------------------------------------------------------------------------------------------------

-- Fonction : La Boutique

-- Commentaire : Cette commande permet a l'utilisateur de récupérer les objets qu'il à commandé par le biais

de la boutique disponible sur le site internet.

-----------------------------------------------------------------------------------------------------------*/

bool ChatHandler::HandleBoutique(const char *args) {

Player *player = m_session->GetPlayer();

// si aucun argument renvoie à l'aide

if (!*args)

{

SendSysMessage(LANG_BOUTIQUE_HELP);

return true;

}

// Lecture des arguments

std::string argstr = (char*)args;

QueryResult *result = NULL;

uint64 guid = player->GetGUID();

// ################ PARTIE ITEM ####################

if (argstr == "item")

{

result = CharacterDatabase.PQuery("SELECT * FROM boutique_items WHERE player_guid = '%u'",guid);

if (!result) {

// Si aucun item

PSendSysMessage(LANG_BOUTIQUE_NOITEM);

delete result;

return true;

}

// Si il y a un ou plusieurs items

do

{

Field *fields = result->Fetch();

uint32 idAchat = fields[0].GetUInt32();

uint32 itemIdselect = fields[2].GetUInt32();

uint32 count = fields[3].GetUInt32();

QueryResult *resultitem = WorldDatabase.PQuery("SELECT entry,name FROM item_template WHERE entry = %u",itemIdselect);

if(!resultitem) {

PSendSysMessage("Une erreur est survenue durant, veuillez contacter un administrateur");

delete resultitem;

return true;

} else {

Field *fieldsitem = resultitem->Fetch();

uint32 itemId = fieldsitem[0].GetUInt32();

std::string itemName = fieldsitem[1].GetString();

uint32 noSpaceForCount = 0;

std::string name = player->GetName();

ItemPosCountVec dest;

uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemId, count,&noSpaceForCount );

if( msg == EQUIP_ERR_OK )

{

Item* item = player->StoreNewItem( dest, itemId, true);

player->SendNewItem(item,1,false,true);

// Suppresion de l'item dans la base d'achat

CharacterDatabase.PExecute("DELETE FROM boutique_items WHERE id = '%u'",idAchat);

delete resultitem;

}

else

{

player->SendEquipError( msg, NULL, NULL );

}

}

} while(result->NextRow());

PSendSysMessage(LANG_BOUTIQUE_THKITEM);

this->HandleSaveCommand(NULL);

delete result;

return true;

}

// ################ PARTIE SKILL ####################

if (argstr == "skill")

{

result = CharacterDatabase.PQuery("SELECT * FROM boutique_skills WHERE player_guid = '%u'",guid);

if (!result) {

// Si aucun skill

PSendSysMessage(LANG_BOUTIQUE_NOSKILL);

delete result;

return true;

}

do {

Field *fields = result->Fetch();

uint32 idAchat = fields[0].GetUInt32();

uint32 spellToLearn = fields[2].GetUInt32();

uint32 skillToLearn = fields[3].GetUInt32();

uint16 skillToLearnValue = fields[4].GetUInt16();

if(player->HasSpell(spellToLearn)) {

PSendSysMessage(LANG_YOU_KNOWN_SPELL);

delete result;

return true;

}

SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellToLearn);

if(!spellInfo)

{

PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spellToLearn);

return true;

}

player->learnSpell(spellToLearn);

player->SetSkill(skillToLearn,skillToLearnValue,player->GetMaxSkillValue(skillToLearn));

CharacterDatabase.PExecute("DELETE FROM boutique_skills WHERE id = '%u'",idAchat);

} while (result->NextRow());

this->HandleSaveCommand(NULL);

PSendSysMessage(LANG_BOUTIQUE_THKITEM);

delete result;

return true;

}

// ################ PARTIE LEVEL ####################

if (argstr == "level")

{

result = CharacterDatabase.PQuery("SELECT * FROM boutique_level WHERE player_guid = '%u'",guid);

if (!result) {

// Si aucun level

PSendSysMessage(LANG_BOUTIQUE_NOLEVEL);

delete result;

return true;

}

do {

Field *fields = result->Fetch();

uint32 idAchat = fields[0].GetUInt32();

uint32 desiredLevel = fields[2].GetUInt32();

uint32 playerLevel = player->getLevel();

uint32 destLevel = 0;

if(playerLevel >= 100) {

PSendSysMessage(LANG_BOUTIQUE_LEVELMAX);

CharacterDatabase.PExecute("DELETE FROM boutique_level WHERE id = '%u'",idAchat);

delete result;

return true;

}

destLevel = desiredLevel - playerLevel;

char levelUpCmd[50];

sprintf(levelUpCmd,"%s %i",player->GetName(),destLevel);

this->HandleLevelUpCommand(levelUpCmd);

CharacterDatabase.PExecute("DELETE FROM boutique_level WHERE id = '%u'",idAchat);

} while (result->NextRow());

this->HandleMaxSkillCommand(NULL);

this->HandleSaveCommand(NULL);

PSendSysMessage(LANG_BOUTIQUE_THKITEM);

delete result;

return true;

}

// Si aucune condition n'es satisfaite, renvoie à l'aide

SendSysMessage(LANG_BOUTIQUE_HELP);

delete result;

return true;

}

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use