Results 1 to 10 of 180

Thread: 034 Alchemist [400] v1.0.5

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. Default

    Yep there we go fully optimized:
    Code:
    public OnAbilityCommand( client, ability, bool:pressed )
    {
        if(War3_GetRace(client) == thisRaceID && IsPlayerAlive(client))
        {
            if(pressed)
            {
                switch (ability)
                {
                    //Plant
                    case 0:
                    {
                        new skill_level = skill_level_item[client];
                        if(skill_level > 0 && !Silenced(client))
                        {
                            
                        }
                    }
                    
                    //Activate
                    case 1:
                    {
                        new skill_level = skill_level_item[client];
                        if(skill_level > 0 && !Silenced(client))
                        {
                            
                        }
                    }
                }
            }
        }
    }
    Note that with only 2 cases there is not any major performance gain as it should be almost exactly the same as an if else but as soon as there is more than 2 this method is better and is thus preferred. Also it can make things easier to read.
    Last edited by ZERO; 07-14-2014 at 03:10 PM.



  2. Default

    Holy crap, nearly 500 lines later I got the basic structure for the ability casting and creating the structure to find players to ban from having items.

    It turns out there is supposed to be a buff for disabling items called bPerplexed but it is not implemented. For the sake of simplicity I will do it that way and then just make a special case for abilities that are not activated. Thus while a user has the bPerplexed buff their items will simply not work. If they have an item that is a 1 time grant like health I will just detect that and remove and give back the health if the user still has the item when it is time for them to get the restored amount.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •