Jump to content
For maintenance and updates, the community will be offline on 31 December 2022 ×
  • 0

Block riding on mount with wedding armor equipped


ReFresh

Question

  • Premium

Hey guys,

I'm trying to prevent player from using mount (RideItem) with wedding armor equipped.

I tried to do this, but it doesn't work (questlua_pc.cpp - pc_mount):

Spoiler
//PLAYER CAN'T RIDE ON MOUNT WITH WEDDING ARMOR EQUIPPED
		LPITEM armor = ch->GetWear(WEAR_BODY);
		LPITEM item = ch->GetWear(WEAR_UNIQUE1);
		LPITEM item2 = ch->GetWear(WEAR_UNIQUE2);
		
		if (armor && (armor->GetVnum() >= 11901 && armor->GetVnum() <= 11904))
		{
			if ((item->IsRideItem()) || (item2->IsRideItem()))
			{
				ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot ride a mount when wedding armor is equipped."));
				return 0;
			}
		}
//PLAYER CAN'T RIDE ON MOUNT WITH WEDDING ARMOR EQUIPPED

 

Anyone got another idea for fix?

Thanks for answers!

Sincerely,

ReFresh

Edited by ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
  • Premium

@SamuraiHUN Thanks, but there is still one problem. It doesn't work when you click on RideItem with mouse, you can still ride on mount with wedding dress. (Your code working only when you use CTRL+G shortcut). Could it be fixed by source side too or it's quest problem now and I need to add some check in ride.quest?

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • 0
  • Premium

Someone got an idea for a fix? I tried to block equipping mount item with item dress equipped by tons of ways but I wasn't successful. Will be glad if someone got solution.

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • 0
  • Distinguished Member
On 10/28/2021 at 10:44 PM, ReFresh said:

I need to add some check in ride.quest?

Actually yes, look for if pc.is_polymorphed() then syschat("You are polymorphed...") and add

            elseif pc.get_wear(0) >= 11901 and pc.get_wear(0) <= 11904 then
                syschat("No wedding dress allowed.")
Spoiler
		when 71114.use or 71115.use or 71116.use or 71117.use or 71118.use or 71119.use or 71120.use or 71121.use 
		or 71171.use or 71172.use or 71161.use or 71124.use or 71125.use or 71126.use or 71127.use or 71128.use 
		or 71137.use or 71138.use or 71139.use or 71140.use or 71141.use or 71142.use 
		or 71131.use or 71132.use or 71133.use or 71134.use or 71164.use or 71165.use or 71166.use 
		begin
			 if pc.is_polymorphed() then
				syschat("Átváltozva nem használhatod!")
			elseif pc.get_wear(0) >= 11901 and pc.get_wear(0) <= 11904 then
				syschat("Nem viselhetsz esküvői ruhát!")
			elseif false == pc.is_riding() then
			 	if true == horse.is_summon() then
					horse.unsummon()
				end
				 ride.Ride(item.vnum, 0)
			 else
				syschat("Először szállj le a mountról a ctrl+g billentyűvel!")
			 end
		end

 

Link to comment
Share on other sites

  • 0
  • Premium

@ TMP4 I did the same thing:

Spoiler
			local blockedItems = {11901, 11902, 11903, 11904};
			local wearPositions = {0}
			

				for i = 1, table.getn(blockedItems) do
					for j = 1, table.getn(wearPositions) do
						if (pc.get_wear(wearPositions[j]) == blockedItems[i]) then
							syschat("No wedding dress allowed")
							return
						end -- if
					end -- for
				end -- for
			end

 

But ride item is still equipping that's the last thing which I need to fix.

Edited by ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • 0
  • Distinguished Member
59 minutes ago, ReFresh said:

@ TMP4 I did the same thing:

  Reveal hidden contents
			local blockedItems = {11901, 11902, 11903, 11904};
			local wearPositions = {0}
			

				for i = 1, table.getn(blockedItems) do
					for j = 1, table.getn(wearPositions) do
						if (pc.get_wear(wearPositions[j]) == blockedItems[i]) then
							syschat("No wedding dress allowed")
							return
						end -- if
					end -- for
				end -- for
			end

 

But ride item is still equipping that's the last thing which I need to fix.

I think Samurai code is not right here in char_item CHARACTER::EquipItem:

    if (item->IsRideItem())
    {
        if (IsRiding())
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ŔĚąĚ Ĺ»°ÍŔ» ŔĚżëÁßŔÔ´Ď´Ů."));
            return false;
        }

        if (IsPolymorphed())
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("şŻ˝Ĺ »óĹÂżˇĽ­´Â ¸»żˇ Ĺ» Ľö ľř˝Ŕ´Ď´Ů."));
            return false;
        }
        
        if (iWearCell == (item->GetVnum() >= 11901 && item->GetVnum() <= 11904))
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»Ŕ» Ĺş »óĹÂżˇĽ­ żąşąŔ» ŔÔŔ» Ľö ľř˝Ŕ´Ď´Ů."));
            return false;
        }
    }

Change it to:

    if (item->IsRideItem())
    {
        if (IsRiding())
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ŔĚąĚ Ĺ»°ÍŔ» ŔĚżëÁßŔÔ´Ď´Ů."));
            return false;
        }

        if (IsPolymorphed())
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("şŻ˝Ĺ »óĹÂżˇĽ­´Â ¸»żˇ Ĺ» Ľö ľř˝Ŕ´Ď´Ů."));
            return false;
        }
        
        LPITEM checkItem = GetWear(WEAR_BODY);
        if (checkItem && checkItem->GetVnum() >= 11901 && checkItem->GetVnum() <= 11904)
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»Ŕ» Ĺş »óĹÂżˇĽ­ żąşąŔ» ŔÔŔ» Ľö ľř˝Ŕ´Ď´Ů."));
            return false;
        }
    }
                                                                                       

I tested and it should work.

Edited by TMP4
  • Love 2
Link to comment
Share on other sites

  • 0
  • Bronze
14 hours ago, TMP4 said:

I think Samurai code is not right here in char_item CHARACTER::EquipItem:

    if (item->IsRideItem())
    {
        if (IsRiding())
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ŔĚąĚ Ĺ»°ÍŔ» ŔĚżëÁßŔÔ´Ď´Ů."));
            return false;
        }

        if (IsPolymorphed())
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("şŻ˝Ĺ »óĹÂżˇĽ­´Â ¸»żˇ Ĺ» Ľö ľř˝Ŕ´Ď´Ů."));
            return false;
        }
        
        if (iWearCell == (item->GetVnum() >= 11901 && item->GetVnum() <= 11904))
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»Ŕ» Ĺş »óĹÂżˇĽ­ żąşąŔ» ŔÔŔ» Ľö ľř˝Ŕ´Ď´Ů."));
            return false;
        }
    }

Change it to:

    if (item->IsRideItem())
    {
        if (IsRiding())
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ŔĚąĚ Ĺ»°ÍŔ» ŔĚżëÁßŔÔ´Ď´Ů."));
            return false;
        }

        if (IsPolymorphed())
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("şŻ˝Ĺ »óĹÂżˇĽ­´Â ¸»żˇ Ĺ» Ľö ľř˝Ŕ´Ď´Ů."));
            return false;
        }
        
        LPITEM checkItem = GetWear(WEAR_BODY);
        if (checkItem && checkItem->GetVnum() >= 11901 && checkItem->GetVnum() <= 11904)
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»Ŕ» Ĺş »óĹÂżˇĽ­ żąşąŔ» ŔÔŔ» Ľö ľř˝Ŕ´Ď´Ů."));
            return false;
        }
    }
                                                                                       

I tested and it should work.

thank you i updated. ^^

  • Love 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Activity

    1. 0

      Need Help With Char_Item.cpp

    2. 0

      ULTERIUS2.COM

    3. 7

      Killua - Unholy God Set

    4. 2

      Visual studio 2022 compiling issue

    5. 991

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.