Jump to content

anon

Inactive Member
  • Posts

    5
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by anon

  1. I think POINT_PARTY_HASTE_BONUS gives speed attack. Value of that bonus you can find in

    void CParty::ComputeRolePoint(LPCHARACTER ch, BYTE bRole, bool bAdd)
    here
    		case PARTY_ROLE_HASTE:
    			{
    				int iBonus = (int) (1+5*k);
    				if (ch->GetPoint(POINT_PARTY_HASTE_BONUS) != iBonus)
    				{
    					ch->PointChange(POINT_PARTY_HASTE_BONUS, iBonus - ch->GetPoint(POINT_PARTY_HASTE_BONUS));
    					ch->ComputePoints();
    				}
    			}
    			break;

     

    If you want to change POINT_PARTY_HASTE_BONUS which gives attack speed to something else there are couple ways to do this.

    So for example If you want to change POINT_PARTY_HASTE_BONUS from attack speed to strong against monsters:

    First one is about changing where bonus you want is calculated to do this:

     

    you need to remove

    PointChange(POINT_ATT_SPEED, GetPoint(POINT_PARTY_HASTE_BONUS)); from
    void CHARACTER::ComputePoints()
    and
    then add value of POINT_PARTY_HASTE_BONUS during calculation of attack bonus
    so in
    int CalcAttBonus(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, int iAtk)
    you change
    iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_MONSTER)) / 100;
    to
    iAtk += (iAtk * (pkAttacker->GetPoint(POINT_ATTBONUS_MONSTER) + pkAttacker->GetPoint(POINT_PARTY_HASTE_BONUS))) / 100;
     
    after this you should see diference in dmg
     
    but also there is another way.
    little bit different
    where you have POINT_ATTBONUS_MONSTER as value of that particular bonus and when ComputePoints is invoken POINT_PARTY_HASTE_BONUS is added to POINT_ATTBONUS_MONSTER bonus value.
    In this case you can see real bonus value in client in your bonus value window without adding value of POINT_PARTY_HASTE_BONUS. But probably you will send more data during ComputePoints.
    If you want second version tell me then I will try to add some code.
     
    Also probably there are another ways to do this kind of stuff.
     
     
     
     
     
     
    • Love 1
  2. Hi Cristian,

     

    item.cpp isn't probably the best place to add this restriction.

    What I would do to implement this is :

    in char_item.cpp

    Above bool CHARACTER::CanEquipNow(const LPITEM item, const TItemPos& srcCell, const TItemPos& destCell)
    add

    
    
    bool isSpeedShoe(DWORD itemVnum)
    {
    	return (itemVnum == UNIQUE_ITEM_SPEED_SHOES) || (itemVnum == UNIQUE_ITEM_SPEED_SHOES2) || (itemVnum == UNIQUE_ITEM_SPEED_SHOES3); 
    }

     

    in bool CHARACTER::CanEquipNow(const LPITEM item, const TItemPos& srcCell, const TItemPos& destCell)

    in if (item->GetWearFlag() & WEARABLE_UNIQUE)

    add

    		if (isSpeedShoe(item->GetVnum))
    		{
    			if ((GetWear(WEAR_UNIQUE1) && isSpeedShoe(GetWear(WEAR_UNIQUE1)->GetVnum())) ||
    				(GetWear(WEAR_UNIQUE2) && isSpeedShoe(GetWear(WEAR_UNIQUE2)->GetVnum())))
    			{
    				ChatPacket(CHAT_TYPE_INFO, "You cannot equip this item twice");
    				return false;
    			}
    		}

     

     

     

     

    32 minutes ago, CristianDragan said:

    Version of Files XXX

    1. Description of the problem / Question :

    I installed three pair of speed shoes on my server, and I want to know how to make an restriction when trying to equip a second pair of shoes, with that error message: "You cannot equip this item twice."

    I already tried something in item.cpp :

     

    else if (GetType() == ITEM_UNIQUE)
        {
            if (ch->GetWear(SPEED_SHOES))
                return SPEED_SHOES2;
            else
                return SPEED_SHOES;

            else
                return SPEED_SHOES3;
        }

     

    but when I'm trying to compile the source I get:  'SPEED_SHOES1/2/3' was not declared in this scope

    I allready added UNIQUE_ITEM_SPEED_SHOES = 72701, UNIQUE_ITEM_SPEED_SHOES2 = 72702, UNIQUE_ITEM_SPEED_SHOES3 = 72703,   in unique_item.h.

     

    Sorry for my bad english.

     

    Thanks, Sincerly,
    Cristian

     

     

    • Love 1
  3. 41 minutes ago, Johnny69 said:

    Chromium documentation and source are public and is not that hard to implement it, if I have time in the next day i will post a tutorial.

    It doesn't look very straightforward for me. I would be very grateful if you would post tutorial specific to mt binary.

    For example I've looked at CEF documentaiton and I have many questions. Like when I should create instance of browser. In documentation it says a lot about how many processess, and resources it needs, so probably I need to create instance only when player wants to use this feature and destroy instance when player finished?. Should I create another thread to run this? How to communicate with this thread - using some kind of mutexes? What If i want reload page, or go back one page in history. Probably version with dll is better than static compilation, which other dlls I need to put in my client?

  4. Hi

    Recently I was thinking about alternatives to CWebBrowser in client binary. There is requirement in my current project to display web-pages which are modern heavy JavaScript types one. Based on my experience I can tell that,  CWebBrowser is not able to handle rendering of modern websites. As alternative I found Chromium Embedded Framework and it seems like reasonable choose. Before I start any work I want to know your opinion guys.

     

    1. Question :

    How would you handle displaying modern  websites in Client? Maybe there is some python based solution I don't know about, or c++ based? Or there is possible to fix current CWebBrowser solution?

     

     

    I am really curious about your ideas.

     

    Thanks, Sincerly,
    Anon

     

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