[FIX] Martysama 5.7 Binek

  • Konuyu açan Konuyu açan M29
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 0
  • Gösterim Gösterim 140

M29

MT Üye
MT Üye
Mesaj
309
Çözümler
7
Beğeni
179
Puan
749
Ticaret Puanı
0
Hello, guys.

I previously tried using Marty 5.7, but there was a problem I couldn't solve.
It was that the mount wouldn't appear after riding them, and I didn't know exactly why. I tried deleting the old system and installing a completely new one, but it didn't work. I was forced to use Marti 5.8, even though I didn't want to. But after using Marty 5.8, my skills improved and I gained more experience. So I took the issue a little more seriously and went back to solving the problem in 5.7. When I asked someone, they wouldn't tell me the reason, and some were asking for $100 to solve this problem. I don't know why.

Let's get to the heart of the matter.

The solution is that the system doesn't work without a task, with a simple modification to the server source.

char.cpp

Search

Kod:
Genişlet Daralt Kopyala
        case POINT_MOUNT:
            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);

replace

Kod:
Genişlet Daralt Kopyala
        case POINT_MOUNT:
            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
            MountVnum(val);
            break;

Screenshot_3.webp


Char_item.cpp

Search

Kod:
Genişlet Daralt Kopyala
        if (item->IsOldMountItem()) // @fixme152
            quest::CQuestManager::instance().SIGUse(GetPlayerID(), quest::QUEST_NO_NPC, item, false);
        #ifdef ENABLE_MOU[HASH=2]#ifdef[/HASH]YSTEM
        else if (item->IsNewMountItem()) {
            const auto mountVnum = GetPoint(POINT_MOUNT);
            MountVnum(mountVnum);
        }
        #endif

Replace it accordingly.

Kod:
Genişlet Daralt Kopyala
        if (item->IsOldMountItem() || item->IsNewMountItem()) // @fixme152
            quest::CQuestManager::instance().SIGUse(GetPlayerID(), quest::QUEST_NO_NPC, item, false);
    //    #ifdef ENABLE_MOUNT_COSTUME_EX_SYSTEM
    //    else if (item->IsNewMountItem()) {
    //        const auto mountVnum = GetPoint(POINT_MOUNT);
    //        MountVnum(mountVnum);
    //    }
    //    #endif

Screenshot_2.webp


Then use this quest

Lua (Quest):
Genişlet Daralt Kopyala
quest ride begin
    state start begin
        function GetRideInfo(vnum, mount_vnum)
            -- all seals type ITEM_UNIQUE (16), subtype UNIQUE_SPECIAL_RIDE (2) or UNIQUE_SPECIAL_MOUNT_RIDE (3), and inside the group 10030 in special_item_group.txt
            -- all seals type ITEM_COSTUME (28), and subtype COSTUME_MOUNT (2) with LimitType0 == LIMIT_REAL_TIME (7)
            mount_info = {}
            if mount_vnum==nil then
                mount_info["mount_vnum"] = item.get_value(4)
            else
                mount_info["mount_vnum"] = mount_vnum
            end
            mount_info["duration"] = 60*60*24*365
            mount_info["req_level"] = -1
            return mount_info
        end

        function Ride(vnum, remain_time, mount_vnum)
            local mount_info = ride.GetRideInfo(vnum, mount_vnum)
            if mount_info["req_level"] ~= nil and pc.level < mount_info["req_level"] then
                syschat("Level not enough")
            else
                if 112 == pc.get_map_index() then -- duel map
                    return
                end

                if remain_time==0 then
                    if mount_info["duration"] <= 0 then
                        if item.is_available0() then
                            remain_time = item.get_socket(0)
                        else
                            remain_time = 60
                        end
                    else
                        remain_time = mount_info["duration"]
                    end
                end

                -- syschat("duration "..remain_time)
                -- syschat("socket1 "..item.get_socket(1))
                -- syschat("socket2 "..item.get_socket(2))
                -- syschat(string.format("pc.mount %d %d", mount_info["mount_vnum"], remain_time))
                pc.mount(mount_info["mount_vnum"], remain_time)
                if mount_info["bonus_id"]~= nil then --deprecated way of adding bonus
                    pc.mount_bonus(mount_info["bonus_id"], mount_info["bonus_value"], remain_time)
                end
            end
        end

        when login begin
            local vnum, remain_time, mount_vnum = pc.get_special_ride_vnum()
            -- syschat(string.format("vnum %d remain_time %d mount_vnum %d", vnum, remain_time, mount_vnum))
            -- syschat("remain_time "..remain_time)
            if vnum==0 then return end

            local mount_info = ride.GetRideInfo(vnum)
            if mount_info==nil then return end

            -- syschat(string.format("vnum %d remain_time %d", vnum, remain_time))
            ride.Ride(vnum, remain_time, mount_vnum)
        end

        when sig_use begin
            if pc.is_polymorphed() then
                syschat("You are transformed")
            elseif not pc.is_riding() then
                if horse.is_summon() then
                    horse.unsummon()
                end
                ride.Ride(item.vnum, 0)
            else
                syschat("You are already riding")
            end
        end
    end
end

The system will work with you comfortably and at full capacity.
 
Geri
Üst