1. OnBuildingBlockUpgrade does not seem to be valid anymore and I cannot find it or an equivalent in the assembly.
     
  2. Wulf

    Wulf Community Admin

  3. I have been working on trying to keep HuntRPG bug free since the guy stopped working on it quite a while ago. The problem is that upgrading does not give experience anymore to the player.
    Code:
            [HookMethod("OnBuildingBlockDoUpgradeToGrade")]
            object OnBuildingBlockUpgrade(BuildingBlock buildingBlock, BaseEntity.RPCMessage message, BuildingGrade.Enum grade)
            {
                HuntRPGInstance.OnBuildingBlockUpgrade(message.player, buildingBlock, grade);
                return null;
            }        public void OnBuildingBlockUpgrade(BasePlayer player, BuildingBlock buildingBlock, BuildingGrade.Enum grade)
            {
                var items = buildingBlock.blockDefinition.grades[(int) grade].costToBuild;
                int total = items.Sum(item => (int) item.amount);
                int experience = (int) Math.Ceiling(UpgradeBuildingTable[grade]*total);
                ExpGain(RPGInfo(player), experience, player);
            }
    [DOUBLEPOST=1438918731][/DOUBLEPOST]I have tested the EXP section below and linked it to crafting instead and it works fine giving EXP that way, but detecting when a player upgrades something does not seem to work.
    [DOUBLEPOST=1438919014][/DOUBLEPOST]WOOO !! nvm I fixed it.
    Code:
            [HookMethod("OnStructureUpgrade")]
            object OnStructureUpgrade(BuildingBlock buildingBlock, BasePlayer player, BuildingGrade.Enum grade)
            {
                HuntRPGInstance.OnStructureUpgrade(buildingBlock, player, grade);
                return null;
            }        public void OnStructureUpgrade(BuildingBlock buildingBlock, BasePlayer player, BuildingGrade.Enum grade)
            {
                var items = buildingBlock.blockDefinition.grades[(int) grade].costToBuild;
                int total = items.Sum(item => (int) item.amount);
                int experience = (int) Math.Ceiling(UpgradeBuildingTable[grade]*total);
                ExpGain(RPGInfo(player), experience, player);
            }
     
    Last edited by a moderator: Aug 7, 2015
  4. Wulf

    Wulf Community Admin

    There is no OnBuildingBlockDoUpgradeToGrade hook, if there was, it was only intended as an internal hook that shouldn't be used by plugins.

    Check out the HuntRPG thread for a working, fixed version with improvements by Nogrod though.
     
  5. His version does not have this fixed unfortunatly, but it's fine the post above that I made works fine now I managed to get it working.