Jump to content

ifilgud

Members
  • Posts

    38
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by ifilgud

  1. If you get error 500 I think it's because you dont have mod_rewrite enabled. And if you have it but it is not working, is because the rules in .htaccess.

    I had to edit the file and add the option mentioned in my first post, RewriteBase.

    If your armory is under vwc/armory the option might be: RewriteBase /vwc/armory

  2. Hi! I've had the rewrite problem today and I managed to find the real problem and a solution!

    I've installed the armory web using an alias in apache 2.2, but the rewrite module does not work perfectly with aliases and htaccess files.

    I only needed to add this option to .htaccess file in the root folder:

    RewriteBase Alias_Name

    For example, my alias is /armory, so the file contains this:

    # UTF8 support

    AddDefaultCharset utf8

    php_value default_charset UTF-8

    RewriteEngine On

    RewriteBase /armory/

    RewriteRule ^(.*).xml $1.php?%{QUERY_STRING}

    I hope this can help other people :)

    Bye!

  3. Hi! I've tried to apply the patch to revision 10317 and it fails in file GridNotifiers.h:

    patching file src/game/GridNotifiers.h

    Hunk #1 FAILED at 502.

    1 out of 2 hunks FAILED -- saving rejects to file src/game/GridNotifiers.h.rej

    The rest of the files apply but offsets are needed:

    patching file sql/CUSTOM/21_mangos_DK_ghouls_raise_dead.sql

    patching file src/game/GridNotifiers.h

    Hunk #1 FAILED at 502.

    1 out of 2 hunks FAILED -- saving rejects to file src/game/GridNotifiers.h.rej

    patching file src/game/Pet.cpp

    patching file src/game/Player.cpp

    Hunk #1 succeeded at 17597 (offset -2 lines).

    patching file src/game/Spell.cpp

    Hunk #2 succeeded at 1547 (offset 6 lines).

    Hunk #3 succeeded at 1563 (offset 6 lines).

    Hunk #4 succeeded at 3391 (offset -26 lines).

    patching file src/game/SpellEffects.cpp

    patching file src/game/StatSystem.cpp

    patching file src/game/Unit.cpp

    Hunk #1 succeeded at 5744 (offset 15 lines).

    Hunk #2 succeeded at 5762 (offset 15 lines).

  4. Hi! I've modified MaNGOS so you can define some entries in mail_level_reward that allows you to send items to players automatically when the reach specific level. The already implemented system only allows sending mail templates to players without items.

    This is useful for admins to reward players with whatever the want :)

    Modifications:

    SQL -> table mail_level_reward has now three more columns: 'item', 'subject' and 'text'.

    If you want to send a custom mail with one item, you have to set field 'mailTemplateId' to 0, if you dont do that, the entry will be handled as normal templated mail. Once you set 'mailTemplateId' to 0, you have to provide a vaild itemId, raceMask, sender (choose a creature :)), mail subject and mail body.

    I will also attach the core patch in addition to SQL patch, and I've also posted this on UDB forum :)

    If anyone has suggestions, please post!

    Edit: I dont know how to attach files (cant see the option!) so I will include the patches in the post:

    diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
    index ba3ffde..b12fb26 100644
    --- a/src/game/ObjectMgr.cpp
    +++ b/src/game/ObjectMgr.cpp
    @@ -8197,7 +8197,7 @@ void ObjectMgr::LoadMailLevelRewards()
        m_mailLevelRewardMap.clear();                           // for reload case
    
        uint32 count = 0;
    -    QueryResult *result = WorldDatabase.Query("SELECT level, raceMask, mailTemplateId, senderEntry FROM mail_level_reward");
    +    QueryResult *result = WorldDatabase.Query("SELECT level, raceMask, mailTemplateId, senderEntry, item, subject, text FROM mail_level_reward");
    
        if( !result )
        {
    @@ -8222,6 +8222,9 @@ void ObjectMgr::LoadMailLevelRewards()
            uint32 raceMask       = fields[1].GetUInt32();
            uint32 mailTemplateId = fields[2].GetUInt32();
            uint32 senderEntry    = fields[3].GetUInt32();
    +        uint32 item           = fields[4].GetUInt32();
    +        std::string subject   = fields[5].GetCppString();
    +        std::string text      = fields[6].GetCppString();
    
            if(level > MAX_LEVEL)
            {
    @@ -8237,8 +8240,19 @@ void ObjectMgr::LoadMailLevelRewards()
    
            if(!sMailTemplateStore.LookupEntry(mailTemplateId))
            {
    -            sLog.outErrorDb("Table `mail_level_reward` have invalid mailTemplateId (%u) for level %u that invalid not include any player races, ignoring.",mailTemplateId,level);
    -            continue;
    +            if (mailTemplateId == 0) // item must have valid id
    +            {
    +                if (!sItemStorage.LookupEntry<ItemPrototype >(item))
    +                {
    +                    sLog.outErrorDb("Table `mail_level_reward` have invalid mailTemplateId (%u) and item (%u) for level %u that invalid not include any player races, ignoring.",mailTemplateId,item,level);
    +                    continue;
    +                }
    +            }
    +            else
    +            {
    +                sLog.outErrorDb("Table `mail_level_reward` have invalid mailTemplateId (%u) for level %u that invalid not include any player races, ignoring.",mailTemplateId,level);
    +                continue;
    +            }
            }
    
            if(!GetCreatureTemplateStore(senderEntry))
    @@ -8247,7 +8261,7 @@ void ObjectMgr::LoadMailLevelRewards()
                continue;
            }
    
    -        m_mailLevelRewardMap[level].push_back(MailLevelReward(raceMask,mailTemplateId,senderEntry));
    +        m_mailLevelRewardMap[level].push_back(MailLevelReward(raceMask,mailTemplateId,senderEntry,item,subject,text));
    
            ++count;
        }
    diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h
    index d2fac42..c11415e 100644
    --- a/src/game/ObjectMgr.h
    +++ b/src/game/ObjectMgr.h
    @@ -226,12 +226,15 @@ struct PetLevelInfo
    
    struct MailLevelReward
    {
    -    MailLevelReward() : raceMask(0), mailTemplateId(0), senderEntry(0) {}
    -    MailLevelReward(uint32 _raceMask, uint32 _mailTemplateId, uint32 _senderEntry) : raceMask(_raceMask), mailTemplateId(_mailTemplateId), senderEntry(_senderEntry) {}
    +    MailLevelReward() : raceMask(0), mailTemplateId(0), senderEntry(0), item(0), subject(NULL), text(NULL) {}
    +    MailLevelReward(uint32 _raceMask, uint32 _mailTemplateId, uint32 _senderEntry, uint32 _item, std::string _subject, std::string _text) : raceMask(_raceMask), mailTemplateId(_mailTemplateId), senderEntry(_senderEntry), item(_item), subject(_subject), text(_text){}
    
        uint32 raceMask;
        uint32 mailTemplateId;
        uint32 senderEntry;
    +    uint32 item;
    +    std::string subject;
    +    std::string text;
    };
    
    typedef std::list<MailLevelReward> MailLevelRewardList;
    diff --git a/src/game/Player.cpp b/src/game/Player.cpp
    index ea98e3d..41f7781 100644
    --- a/src/game/Player.cpp
    +++ b/src/game/Player.cpp
    @@ -2627,7 +2627,17 @@ void Player::GiveLevel(uint32 level)
            pet->SynchronizeLevelWithOwner();
    
        if (MailLevelReward const* mailReward = sObjectMgr.GetMailLevelReward(level,getRaceMask()))
    -        MailDraft(mailReward->mailTemplateId).SendMailTo(this,MailSender(MAIL_CREATURE,mailReward->senderEntry));
    +    {
    +        if (mailReward->mailTemplateId != 0) // Send mail with customItem instead of a template
    +            MailDraft(mailReward->mailTemplateId).SendMailTo(this,MailSender(MAIL_CREATURE,mailReward->senderEntry));
    +        else
    +        {
    +            MailDraft mail (mailReward->subject.c_str(), mailReward->text.c_str());
    +            Item* item = Item::CreateItem(mailReward->item, 1);
    +            mail.AddItem(item);
    +            mail.SendMailTo(this,MailSender(MAIL_CREATURE,mailReward->senderEntry));
    +        }
    +    }
    
        GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL);
    }
    

    ALTER TABLE mail_level_reward
    ADD COLUMN `item` mediumint(8) unsigned NOT NULL DEFAULT '0',
    ADD COLUMN `subject` varchar(30) DEFAULT NULL,
    ADD COLUMN `text` varchar(100) DEFAULT NULL;
    

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