Raised This Month: $ Target: $400
 0% 

WC3FT changing the scaling with level for shopmenu items.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Indigoism
Junior Member
Join Date: Aug 2014
Old 08-08-2014 , 15:20   WC3FT changing the scaling with level for shopmenu items.
Reply With Quote #1

I would like to disable the scaling with levels so items from shopmenu and shopmenu2 will always cost the same.

I looked into some of the Inc files but I could not find it. Any help will be greatly appriciated!

Indigo
Indigoism is offline
PreDominance
Member
Join Date: Jul 2014
Old 08-08-2014 , 15:32   Re: WC3FT changing the scaling with level for shopmenu items.
Reply With Quote #2

war3ft/items.inl, line 61.
PreDominance is offline
Indigoism
Junior Member
Join Date: Aug 2014
Old 08-08-2014 , 15:43   Re: WC3FT changing the scaling with level for shopmenu items.
Reply With Quote #3

Thank you for your fast response. I did come across this but I didnt know how to edit it. I tried deleting the function but I couldnt it wouldnt compile war3ft.sma after. I also tried changing the values in the function. But now items from shopmenu are less expensive on lower levels. I want i to be equal on all.

While we're at it, I would also like to know a way so certain items dont stack with race abilities. For example:
Sock of Feather stacking with Undeads Levitate.

Any ideas?

Last edited by Indigoism; 08-08-2014 at 16:21.
Indigoism is offline
PreDominance
Member
Join Date: Jul 2014
Old 08-08-2014 , 16:46   Re: WC3FT changing the scaling with level for shopmenu items.
Reply With Quote #4

You're going to have to look up some basic scripting to do that yourself. If you can't figure out how to change the cost of the item (you really tried just "deleting" a return statement?"), then I won't be of much help.

I can tell you how to do things, because I believe that the best way to do things is by yourself, so that you may learn.

Any time you buy a shop item that enhances a user (speed, gravity), check their current speed/gravity (cs_get_user_maxspeed, cs_get_user_gravity, maybe?). If this retrieved value differs from the normal values (-1.0, 1.0), then prevent them from buying the item.
PreDominance is offline
Indigoism
Junior Member
Join Date: Aug 2014
Old 08-08-2014 , 17:48   Re: WC3FT changing the scaling with level for shopmenu items.
Reply With Quote #5

Haha, I dont know anything about the coding. I just want to satisfy the players on my server and fix these two issues (mainly the first). I've tried several things now to make it work but I cant get it to do what I want.
Indigoism is offline
PreDominance
Member
Join Date: Jul 2014
Old 08-08-2014 , 22:25   Re: WC3FT changing the scaling with level for shopmenu items.
Reply With Quote #6

It's as good a time as ever to learn, friend. I will give you a present but I expect that you learn how to modify this kind of stuff on your own.

items.inl, line 65
PHP Code:
public ITEM_CanBuyidiItem )
{
    if (
iItem == ITEM_BOOTS && (floatcmp(floatabs(get_user_maxspeed(id)), 1.0) != 0)) {
        
client_print(idprint_center"Your speed is already enhanced.");
        return 
false;
    } else if (
iItem == ITEM_SOCK && (floatcmp(get_user_gravity(id), 1.0) != 0) {
        
client_print(idprint_center"Your gravity is already enhanced.";
        return 
false;
    }
    
// User doesn't have the money
    
else if ( SHARED_GetUserMoneyid ) < ITEM_CostidiItem ) )
    {
        
client_printidprint_center"%L"id"INSUFFICIENT_FUNDS" );

        return 
false;
    }
    
    
// User already owns the item and it's not a chargeable item!
    
else if ( ITEM_HasidiItem ) > ITEM_NONE && !ITEM_CheckFlagiItemITEM_CHARGEABLE ) )
    {
        
client_printidprint_center"%L"id"ALREADY_OWN_THAT_ITEM" );

        return 
false;
    } 

You should be able to figure it out from here. I've added the two necessary blocks of code. Read what I did, and learn from it!

Last edited by PreDominance; 08-08-2014 at 22:27.
PreDominance is offline
Indigoism
Junior Member
Join Date: Aug 2014
Old 08-09-2014 , 08:57   Re: WC3FT changing the scaling with level for shopmenu items.
Reply With Quote #7

Thanks for taking the time to help me. Cant believe fixing the ratio was as simple as this.
PHP Code:
#define ITEM_COST_RATIO        1.0        // Changed from 0.7 to 1.0 
I tried adding the code you made for me to the items.inl but it wouldnt compile and I have something else to do right now. Ill report back later.

Indigo~

EDIT:
Alright, so I suppose you left out a few signs to make me look at it

PHP Code:
public ITEM_CanBuyidiItem )
{
    if (
iItem == ITEM_BOOTS && (floatcmp(floatabs(get_user_maxspeed(id)), 1.0) != 0)) {
        
client_print(idprint_center"Your speed is already enhanced.");
        return 
false;
    } else if (
iItem == ITEM_SOCK && (floatcmp(get_user_gravity(id), 1.0) != 0)) {
        
client_print(idprint_center"Your gravity is already enhanced.");
        return 
false;
    } 
That did the trick!

Thanks for the help its much appriciated.

Last edited by Indigoism; 08-09-2014 at 14:26.
Indigoism is offline
PreDominance
Member
Join Date: Jul 2014
Old 08-10-2014 , 01:35   Re: WC3FT changing the scaling with level for shopmenu items.
Reply With Quote #8

I am evilly helpful

If you need any additional help, feel free to add me on Steam, or post here. I will always take time to help someone learn, but after awhile I expect you can start to be independent.

Last edited by PreDominance; 08-10-2014 at 01:35.
PreDominance is offline
Indigoism
Junior Member
Join Date: Aug 2014
Old 08-10-2014 , 14:12   Re: WC3FT changing the scaling with level for shopmenu items.
Reply With Quote #9

Problem with your method: You can buy the items on a different race and then switch back to undead and you will keep the items and they will still stack.

Any ideas?

Last edited by Indigoism; 08-10-2014 at 14:12.
Indigoism is offline
PreDominance
Member
Join Date: Jul 2014
Old 08-10-2014 , 16:05   Re: WC3FT changing the scaling with level for shopmenu items.
Reply With Quote #10

shared.inl, line 846
PHP Code:
        // Unholy Aura bonus
        
if ( iSkillLevel 0.0 )
        {
            
fNewSpeed p_unholy[iSkillLevel-1];
            if (
ITEM_Has(idITEM_BOOTS) > ITEM_NONE && (fNewSpeed >= (1.0 get_pcvar_float(CVAR_wc3_boots)))) 
            {
                
ITEM_RemoveID(idITEM_BOOTS);
                
client_print(idprint_chat"Unholy Aura's speed is greater than boots: removing.");
            }
        } 
This will verify that Unholy Aura's speed boost is greater than what boots, give, and if so, remove boots.

shared.inl, line 1096
PHP Code:
            // User has levitation + sock, lolnope.
            
if ( fGravityLevel 1.0 )
            {
                if (
fGravityLevel <= 0.5)
                {
                    
client_print(idprint_chat"Levitation's gravity is better than sock: removing.");
                    
ITEM_RemoveID(idITEM_SOCK);
                }
            } 
Levitation will remove boots if the skill's gravity reduction outdoes the sock's.
I expect you are learning from this, friend.
PreDominance is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode