Jump to content

DarkMessiah

Members
  • Posts

    29
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by DarkMessiah

  1. Thanks i don't get the std:: stuff. else I could be abled to fix it.

    Error    1    error C2660: 'ObjectMgr::CreateItemText' : function does  not take 1 arguments    d:\\SVN\\MaNGOS\\src\\game\\Mail.cpp    1110    game

    It says it needs more than 1 argument in the error. but the method says:

    uint32 CreateItemText (std::string text)

    This looks as 1 argument to me, correct me if i'm wrong.

    EDIT:

    When i change: MailDraft( subject, itemTextId ) to MailDraft( subject, 0 ), we just get that one error.

  2. This is not working with the 3.3.3a release.

    void WorldSession::SendExternalMails()
    {
       sLog.outString("EXTERNAL MAIL> Send Mails from Queue...");
       QueryResult *result = CharacterDatabase.Query("SELECT id,receiver,subject,message,money,item,item_count FROM mail_external");
           if(!result)
           {
              sLog.outString("EXTERNAL MAIL> No Mails in Queue...");
              delete result;
              return;
           }else{
              do{
                  Field *fields = result->Fetch();
                  uint32 id = fields[0].GetUInt32();
                  uint64 receiver_guid = fields[1].GetUInt64();
                  std::string subject = fields[2].GetString();
                  std::string message = fields[3].GetString();
                  uint32 money = fields[4].GetUInt32();
                  uint32 ItemID = fields[5].GetUInt32();
                  uint32 ItemCount = fields[6].GetUInt32();
    
                  Player *receiver = sObjectMgr.GetPlayer( receiver_guid );
    
                  if( receiver != 0 )
                  {
                      sLog.outString("EXTERNAL MAIL> Sending mail to %u, Item:%u", receiver_guid, ItemID);
    
                      uint32 itemTextId = !message.empty() ? sObjectMgr.CreateItemText( message ) : 0;
    
                      if ( ItemID != 0 )
                      {
                          Item* ToMailItem = Item::CreateItem( ItemID, ItemCount, receiver );
                          ToMailItem -> SaveToDB();
    
                          MailDraft( subject, itemTextId )
                              .AddItem( ToMailItem )
                              .AddMoney( money )
                              .SendMailTo( MailReceiver(receiver), MailSender(MAIL_NORMAL, 0, MAIL_STATIONERY_GM), MAIL_CHECK_MASK_RETURNED);
                      }
                      else
                      {
                          MailDraft( subject, itemTextId )
                              .AddMoney( money )
                              .SendMailTo( MailReceiver(receiver), MailSender(MAIL_NORMAL, 0, MAIL_STATIONERY_GM), MAIL_CHECK_MASK_RETURNED);
    
                      }
                      CharacterDatabase.PExecute("DELETE FROM mail_external WHERE id=%u", id);
                  }
                  else
                      sLog.outString("EXTERNAL MAIL> Player %u not in game, skip mail!", receiver_guid);
    
              }while( result -> NextRow() );
          }
      delete result;
      sLog.outString("EXTERNAL MAIL> All Mails Sent...");    
    }

    It gives these errors on compiling:

    Error    1    error C2660: 'ObjectMgr::CreateItemText' : function does not take 1 arguments    d:\\SVN\\MaNGOS\\src\\game\\Mail.cpp    1110    game
    Error    2    error C2665: 'MailDraft::MailDraft' : none of the 3 overloads could convert all the argument types    d:\\SVN\\MaNGOS\\src\\game\\Mail.cpp    1117    game
    Error    3    error C2228: left of '.AddItem' must have class/struct/union    d:\\SVN\\MaNGOS\\src\\game\\Mail.cpp    1117    game
    Error    4    error C2228: left of '.AddMoney' must have class/struct/union    d:\\SVN\\MaNGOS\\src\\game\\Mail.cpp    1117    game
    Error    5    error C2228: left of '.SendMailTo' must have class/struct/union    d:\\SVN\\MaNGOS\\src\\game\\Mail.cpp    1117    game
    Error    6    error C2665: 'MailDraft::MailDraft' : none of the 3 overloads could convert all the argument types    d:\\SVN\\MaNGOS\\src\\game\\Mail.cpp    1124    game
    Error    7    error C2228: left of '.AddMoney' must have class/struct/union    d:\\SVN\\MaNGOS\\src\\game\\Mail.cpp    1124    game
    Error    8    error C2228: left of '.SendMailTo' must have class/struct/union    d:\\SVN\\MaNGOS\\src\\game\\Mail.cpp    1124    game

    Any tips?

  3. You need PHP version 5.0.1 or later, and it must be compiled using --enable-soap or by manually adding extension=php_soap.dll in your PHP.ini. If that all sounds like abracadabra to you, simply go here and download and install the binaries for PHP 5.3.

    If you get an 'HTTP Error: 401 Unauthorized' error you are unauthorized. This means, surprisingly enough, authorization failed. Make sure you use a GM account of at least the level specified by RA.MinLevel (not entirely sure if this value is also used by the SOAP service, but can't hurt to be sure) and of course that your username and password are correct. Your username does not have to be in uppercase though.

    I use XAMPP 1.7.3, with PHP 5.3.x so it should work. But still doesnt.

  4. MANGOS:

    Index: src/game/ItemHandler.cpp
    ===================================================================
    --- src/game/ItemHandler.cpp    (版本 276)
    +++ src/game/ItemHandler.cpp    (工作副本)
    @@ -26,6 +26,8 @@
    #include "Item.h"
    #include "UpdateData.h"
    #include "ObjectAccessor.h"
    +#include "Spell.h"
    +#include "ScriptCalls.h"
    
    void WorldSession::HandleSplitItemOpcode( WorldPacket & recv_data )
    {
    @@ -458,6 +460,7 @@
        //sLog.outDebug( "WORLD: CMSG_READ_ITEM");
    
        uint8 bag, slot;
    +    SpellCastTargets targets;
        recv_data >> bag >> slot;
    
        //sLog.outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot);
    @@ -468,6 +471,8 @@
            WorldPacket data;
    
            uint8 msg = _player->CanUseItem( pItem );
    +        if(!Script->ItemUse(GetPlayer(),pItem,targets))
    +        {
            if( msg == EQUIP_ERR_OK )
            {
                data.Initialize (SMSG_READ_ITEM_OK, 8);
    @@ -480,7 +485,8 @@
                _player->SendEquipError( msg, pItem, NULL );
            }
            data << pItem->GetGUID();
    -        SendPacket(&data);
    +        SendPacket(&data);
    +        }
        }
        else
            _player->SendEquipError( EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL );
    Index: src/game/NPCHandler.cpp
    ===================================================================
    --- src/game/NPCHandler.cpp    (版本 276)
    +++ src/game/NPCHandler.cpp    (工作副本)
    @@ -35,6 +35,7 @@
    #include "BattleGroundMgr.h"
    #include "BattleGround.h"
    #include "Guild.h"
    +#include "Spell.h"
    
    void WorldSession::HandleTabardVendorActivateOpcode( WorldPacket & recv_data )
    {
    @@ -313,9 +314,11 @@
        uint32 option;
        uint32 unk;
        uint64 guid;
    +    SpellCastTargets targets;
        std::string code = "";
    
        recv_data >> guid >> unk >> option;
    +    Item *pItem = _player->GetItemByGuid(guid);
    
        if(_player->PlayerTalkClass->GossipOptionCoded( option ))
        {
    @@ -329,7 +332,8 @@
        Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
        if (!unit)
        {
    -        sLog.outDebug( "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)) );
    +        if (!Script->GossipSelect_Item( _player, pItem, _player->PlayerTalkClass->GossipOptionSender( option ), _player->PlayerTalkClass->GossipOptionAction( option ),targets))
    +        sLog.outDebug( "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)) );
            return;
        }
    
    Index: src/game/ScriptCalls.cpp
    ===================================================================
    --- src/game/ScriptCalls.cpp    (版本 276)
    +++ src/game/ScriptCalls.cpp    (工作副本)
    @@ -73,6 +73,7 @@
            ||!(testScript->ItemQuestAccept     =(scriptCallItemQuestAccept     )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ItemQuestAccept"     ))
            ||!(testScript->GOQuestAccept       =(scriptCallGOQuestAccept       )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GOQuestAccept"       ))
            ||!(testScript->ItemUse             =(scriptCallItemUse             )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ItemUse"             ))
    +        ||!(testScript->GossipSelect_Item   =(scriptCallGossipSelect_Item   )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GossipSelect_Item"   ))
            ||!(testScript->EffectDummyGameObj  =(scriptCallEffectDummyGameObj  )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"EffectDummyGameObj"  ))
            ||!(testScript->EffectDummyCreature =(scriptCallEffectDummyCreature )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"EffectDummyCreature" ))
            ||!(testScript->EffectDummyItem     =(scriptCallEffectDummyItem     )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"EffectDummyItem"     ))
    Index: src/game/ScriptCalls.h
    ===================================================================
    --- src/game/ScriptCalls.h    (版本 276)
    +++ src/game/ScriptCalls.h    (工作副本)
    @@ -55,6 +55,7 @@
    typedef bool(MANGOS_IMPORT * scriptCallGOQuestAccept)(Player *player, GameObject *, Quest const*);
    typedef bool(MANGOS_IMPORT * scriptCallGOChooseReward)(Player *player, GameObject *, Quest const*, uint32 opt );
    typedef bool(MANGOS_IMPORT * scriptCallItemUse) (Player *player, Item *_Item, SpellCastTargets const& targets);
    +typedef bool(MANGOS_IMPORT * scriptCallGossipSelect_Item)(Player *player, Item *_Item, uint32 sender, uint32 action, SpellCastTargets const& targets);
    typedef bool(MANGOS_IMPORT * scriptCallEffectDummyGameObj) (Unit *caster, uint32 spellId, uint32 effIndex, GameObject *gameObjTarget);
    typedef bool(MANGOS_IMPORT * scriptCallEffectDummyCreature) (Unit *caster, uint32 spellId, uint32 effIndex, Creature *crTarget);
    typedef bool(MANGOS_IMPORT * scriptCallEffectDummyItem) (Unit *caster, uint32 spellId, uint32 effIndex, Item *itemTarget);
    @@ -83,6 +84,7 @@
        scriptCallItemQuestAccept ItemQuestAccept;
        scriptCallGOQuestAccept GOQuestAccept;
        scriptCallItemUse ItemUse;
    +    scriptCallGossipSelect_Item GossipSelect_Item;
        scriptCallEffectDummyGameObj  EffectDummyGameObj;
        scriptCallEffectDummyCreature EffectDummyCreature;
        scriptCallEffectDummyItem     EffectDummyItem;

    scriptsev2:

    Index: ScriptMgr.cpp
    ===================================================================
    --- ScriptMgr.cpp    (版本 1237)
    +++ ScriptMgr.cpp    (工作副本)
    @@ -1669,6 +1687,19 @@
    }
    
    MANGOS_DLL_EXPORT
    +bool GossipSelect_Item(Player* pPlayer, Item* _Item, uint32 sender, uint32 action, SpellCastTargets const& targets)
    +{
    +    Script *tmpscript = NULL;
    +
    +    printf("action: %d\\n",action);
    +    pPlayer->PlayerTalkClass->ClearMenus();
    +    tmpscript = m_scripts[_Item->GetProto()->ScriptId];
    +    if (!tmpscript || !tmpscript->pGossipSelect_Item) return false;
    +    
    +    return tmpscript->pGossipSelect_Item(pPlayer,_Item,sender,action,targets);
    +}
    +
    +MANGOS_DLL_EXPORT
    bool QuestSelect(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
    {
        Script *tmpscript = m_scripts[pCreature->GetScriptId()];
    @@ -1791,6 +1822,7 @@
    {
        Script *tmpscript = m_scripts[_Item->GetProto()->ScriptId];
        if (!tmpscript || !tmpscript->pItemUse) return false;
    +    pPlayer->PlayerTalkClass->ClearMenus();
    
        return tmpscript->pItemUse(pPlayer,_Item,targets);
    }
    Index: ScriptMgr.h
    ===================================================================
    --- ScriptMgr.h    (版本 1237)
    +++ ScriptMgr.h    (工作副本)
    @@ -30,8 +30,8 @@
            pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL),
            pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL),
            pChooseReward(NULL), pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL),
    -        pGOQuestAccept(NULL), pGOChooseReward(NULL), pItemUse(NULL),
    -        pEffectDummyCreature(NULL), pEffectDummyGameObj(NULL), pEffectDummyItem(NULL),
    +        pGOQuestAccept(NULL), pGOChooseReward(NULL), pItemUse(NULL),pGossipSelect_Item(NULL),
    +        pEffectDummyCreature(NULL), pEffectDummyGameObj(NULL), pEffectDummyItem(NULL),
            GetAI(NULL), GetInstanceData(NULL)
        {}
    
    @@ -54,6 +54,7 @@
        bool (*pGOQuestAccept       )(Player*, GameObject*, const Quest*);
        bool (*pGOChooseReward      )(Player*, GameObject*, const Quest*, uint32);
        bool (*pItemUse             )(Player*, Item*, SpellCastTargets const&);
    +    bool (*pGossipSelect_Item   )(Player* pPlayer, Item* _Item, uint32 sender, uint32 action, SpellCastTargets const& targets);
        bool (*pEffectDummyCreature )(Unit*, uint32, uint32, Creature*);
        bool (*pEffectDummyGameObj  )(Unit*, uint32, uint32, GameObject*);
        bool (*pEffectDummyItem     )(Unit*, uint32, uint32, Item*);

    SQL:

    INSERT INTO item_template
     (entry, class, subclass, unk0, name, displayid, Quality, Flags, BuyCount, BuyPrice, SellPrice, InventoryType, AllowableClass, AllowableRace, ItemLevel, RequiredLevel, RequiredSkill, RequiredSkillRank, requiredspell, requiredhonorrank, RequiredCityRank, RequiredReputationFaction, RequiredReputationRank, maxcount, stackable, ContainerSlots, StatsCount, stat_type1, stat_value1, stat_type2, stat_value2, stat_type3, stat_value3, stat_type4, stat_value4, stat_type5, stat_value5, stat_type6, stat_value6, stat_type7, stat_value7, stat_type8, stat_value8, stat_type9, stat_value9, stat_type10, stat_value10, ScalingStatDistribution, ScalingStatValue, dmg_min1, dmg_max1, dmg_type1, dmg_min2, dmg_max2, dmg_type2, armor, holy_res, fire_res, nature_res, frost_res, shadow_res, arcane_res, delay, ammo_type, RangedModRange, spellid_1, spelltrigger_1, spellcharges_1, spellppmRate_1, spellcooldown_1, spellcategory_1, spellcategorycooldown_1, spellid_2, spelltrigger_2, spellcharges_2, spellppmRate_2, spellcooldown_2, spellcategory_2, spellcategorycooldown_2, spellid_3, spelltrigger_3, spellcharges_3, spellppmRate_3, spellcooldown_3, spellcategory_3, spellcategorycooldown_3, spellid_4, spelltrigger_4, spellcharges_4, spellppmRate_4, spellcooldown_4, spellcategory_4, spellcategorycooldown_4, spellid_5, spelltrigger_5, spellcharges_5, spellppmRate_5, spellcooldown_5, spellcategory_5, spellcategorycooldown_5, bonding, description, PageText, LanguageID, PageMaterial, startquest, lockid, Material, sheath, RandomProperty, RandomSuffix, block, itemset, MaxDurability, area, Map, BagFamily, TotemCategory, socketColor_1, socketContent_1, socketColor_2, socketContent_2, socketColor_3, socketContent_3, socketBonus, GemProperties, RequiredDisenchantSkill, ArmorDamageModifier, Duration, ItemLimitCategory, ScriptName, DisenchantID, FoodType, minMoneyLoot, maxMoneyLoot)
    VALUES
     (900001, 15, 0, -1, "telestone", 6270, 6, 64, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "where are you want to", 3034, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, "item_teleport", 0, 0, 0, 0

    );

    This script works 50% nowadays. It shows the menu, but when you click one of the Menu Items it does nothin. Can anyone give me a hand fixing this? I can't figure out what's wrong.

  5. Error    49    error C2065: 'guid' : undeclared identifier    d:\\MaNGOS\\src\\game\\Group.cpp    917    game
    Error    50    error C2065: 'guid' : undeclared identifier    d:\\MaNGOS\\src\\game\\Group.cpp    919    game
    Error    51    error C2065: 'guid' : undeclared identifier    d:\\MaNGOS\\src\\game\\Group.cpp    922    game
    Error    52    error C2065: 'guid' : undeclared identifier    d:\\MaNGOS\\src\\game\\Group.cpp    928    game
    

    Cheers :)

  6. Hello everyone,

    I've been trying to rip this autoannouncer patch only out from xeross's repo, but i happen to get a lot of extra stuff which is different aswell which has nothing to do with the autoannouncer.

    Is there anyone who has a working .patch for the latest mangos. Since the old autoannouncer crashes with the new MaNGOS. (I'm sorry i s*ck with GIT :( )

    Thanks on the forehand,

    DarkMessiah

  7. for example: Instead of having 3 or 4 standard ranks which MaNGOS normally has. I replaced it with 8 ranks. Also we have different settings for .gm on and .gm off (when you do .gm on, the GM Chat icon goes on, and off virse versa). Also I have the permission per realm patch applied on my core. And since I run a funserver i have to int64's in stead of int32's because some int's dont fit in the standard mangos. And I have a lot more but i forgot lol ^^.

    Ontopic: The crashes i had before seem not to be caused by the External Mail system but by the AutoBroadcast system I had. I am trying to implement your AutoBroadcast now :)

    EDIT: I tried to apply your Broadcaster.patch which i extracted from your repo (i found the commands on the broadcaster topic). I get a lot of errors. I wonder if you have .patch files for all of your custom made stuff. Since the patches i extract are full of extra stuff which doesn't have anything to do with the broadcaster system). I would be gratefull

    Thanks on the forhand ^^

    EDIT2: git stash apply broadcaster.patch gave me this:

    broadcaster.patch: no valid stashed state found

  8. I tried to do this: git diff master ExternalMail

    Inside my MaNGOS root folder. Now this is what i got back:

    fatal: ambiguous argument `ExternalMail`: unknown revision or path not in the working tree.

    Use `--` to separate paths from revisions

    I have really no idea how i can fix this (again i know little of GIT unfortunately) is there a way you can release a .patch or help me on this quest hehe ^^

  9. Sorry,i can not do that,i am a new for C++,this code is very old and not to work,i only fix it to work.:(

    Hehe im new to MaNGOS i've done some C++ on ArcEmu before and Ascent and before that long time ago i did some on MaNGOS but its like 3 years ago or w/e. Anyway the Menu doesnt clear but that function the other man gave me isn't recognized.

    Any more ideas?

  10. I called the ClearMenus(); function upon the close of any menu.. this was a modification I did to the mangos core. It really should be in there by default anyway.

    so, upon closing the menu, call the ClearMenus(); function in the same script. cant think of the script name atm.

    Error    1    error C2039: 'ClearMenus' : is not a member of 'Player'    c:\\Documents and Settings\\Administrator\\Desktop\\SVN\\MaNGOS\\src\\bindings\\ScriptDev2\\scripts\\custom\\BookofDarkness.cpp    83    ScriptDev2

    This is what i get. Are you sure it is ClearMenus()?

×
×
  • 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