You are correct. That place is indeed where it is triggered.
However, it is just the last step of something more complex. What you call "interfaceIsSelected" is a misleading name.
Take a look at what I've made of it:
I call your method "allScriptConditionsMet".Code:} else if(gameInterface.interfaceType == 5){ //Sprite Sprite sprite; if(allScriptConditionsMet(gameInterface)) sprite = gameInterface.sprite2; else sprite = gameInterface.sprite1; if(spellSelected == 1 && gameInterface.id == spellID && spellID != 0 && sprite != null){ sprite.drawSprite(leftX, topY, 0xffffff); } else { if(sprite != null) sprite.drawSprite(leftX, topY); } if(Autocast && gameInterface.id == spellID && gameInterface.id == autocastId){ magicAuto.drawSprite(leftX - 3, topY - 3); } }
In the 317 revisions, a sort of script could be embedded in the interfaces.
These scripts could do all sorts of things.
Chosing between sprites is one thing.
Setting text in a certain colour is another.
This is what my allScriptConditionsMet method looks like
As you might be able to see, an interface is able to extract/calculate some values and use those values.Code:private boolean allScriptConditionsMet(GameInterface gameInterface){ if(gameInterface.scriptCondition == null) return false; for(int scriptIndex = 0; scriptIndex < gameInterface.scriptCondition.length; scriptIndex++){ int value = extractInterfaceValues(gameInterface, scriptIndex); int comparisonValue = gameInterface.scriptConditionComparisonValue[scriptIndex]; if(gameInterface.scriptCondition[scriptIndex] == 2){ if(value >= comparisonValue) return false; } else if(gameInterface.scriptCondition[scriptIndex] == 3){ if(value <= comparisonValue) return false; } else if(gameInterface.scriptCondition[scriptIndex] == 4){ if(value == comparisonValue) return false; } else if(value != comparisonValue) return false; } return true; }
Let's have a look at "extractInterfaceValues" to see what can be extracted and how this could explain your question.
If you look at opcode 10 you'll see something interesting: you're able to check (and return a large value) if you wield a certain item.Code:private int extractInterfaceValues(GameInterface gameInterface, int scriptIndex){ if(gameInterface.extractScripts == null || scriptIndex >= gameInterface.extractScripts.length) return -2; try{ int instructions[] = gameInterface.extractScripts[scriptIndex]; int finalValue = 0; int index = 0; int operation = 0; do{ int opCode = instructions[index++]; int tempValue = 0; byte doOperation = 0; if(opCode == 0) return finalValue; if(opCode == 1)//Current skill level tempValue = MyPlayer.skillLevel[instructions[index++]]; else if(opCode == 2)//Max skill level tempValue = MyPlayer.skillMaxLevel[instructions[index++]]; else if(opCode == 3)//Current skill exp tempValue = MyPlayer.skillExp[instructions[index++]]; else if(opCode == 4){//Number of a certain item in an itemContainer GameInterface containerInterface = GameInterface.interfaceCache[instructions[index++]]; int itemId = instructions[index++]; if(itemId >= 0 && itemId < ItemDefinition.totalItems && (isMembers || !ItemDefinition.forID(itemId).membersObject)) for(int containerIndex = 0; containerIndex < containerInterface.containerItemIds.length; containerIndex++) if(containerInterface.containerItemIds[containerIndex] == itemId + 1) tempValue += containerInterface.containerStackSizes[containerIndex]; } else if(opCode == 5)//Setting value TODO tempValue = ClientSettings.sessionSettings[instructions[index++]]; else if(opCode == 6)//Levelup exp for a skill tempValue = MyPlayer.levelUpExp[MyPlayer.skillMaxLevel[instructions[index++]] - 1]; else if(opCode == 7)//TODO tempValue = (ClientSettings.sessionSettings[instructions[index++]] * 100) / 46875; else if(opCode == 8)//Combat level tempValue = myPlayer.combatLevel; else if(opCode == 9){//Total level for(int skillId = 0; skillId < Skills.skillsCount; skillId++) if(Skills.skillEnabled[skillId]) tempValue += MyPlayer.skillMaxLevel[skillId]; } else if(opCode == 10){//if container contains item, tempValue is 999.999.999 (like in, wield staff) GameInterface containerInterface = GameInterface.interfaceCache[instructions[index++]]; int itemId = instructions[index++] + 1; if(itemId >= 0 && itemId < ItemDefinition.totalItems && (!ItemDefinition.forID(itemId).membersObject || isMembers)){ for(int containerIndex = 0; containerIndex < containerInterface.containerItemIds.length; containerIndex++){ if(containerInterface.containerItemIds[containerIndex] != itemId) continue; tempValue = 999999999; break; } } } else if(opCode == 11)//Run energy tempValue = MyPlayer.playerRunEnergy; else if(opCode == 12)//Weight tempValue = MyPlayer.weight; else if(opCode == 13){ int settingValue = ClientSettings.sessionSettings[instructions[index++]]; int i3 = instructions[index++]; //TODO below: shifting, orly? tempValue = (settingValue & 1 << i3) == 0 ? 0 : 1; } else if(opCode == 14){//TODO int varbitId = instructions[index++]; tempValue = VarBit.getSettingValue(varbitId); } else if(opCode == 15)//Negation doOperation = 1; else if(opCode == 16)//Division doOperation = 2; else if(opCode == 17)//Multiplication doOperation = 3; else if(opCode == 18)//Player XLoc tempValue = (myPlayer.xPosition >> 7) + baseX; else if(opCode == 19)//Player YLoc tempValue = (myPlayer.yPosition >> 7) + baseY; else if(opCode == 20)//Fixed instruction value tempValue = instructions[index++]; if(doOperation == 0){ if(operation == 0) finalValue += tempValue; else if(operation == 1) finalValue -= tempValue; else if(operation == 2 && tempValue != 0) finalValue /= tempValue; else if(operation == 3) finalValue *= tempValue; operation = 0; } else { operation = doOperation; } } while(true); } catch(Exception _ex){ return -1; } }
In combination with this method you'll start to see the picture come even more together (the * part).
Did I mention these values can be inserted in predetermined places of an interface? Hence the client knowing howmany runes you have.Code:public final String replaceAmountPostFix(int amount){ if(amount >= 0 && amount < 10000) return String.valueOf(amount); if(amount >= 10000 && amount < 10000000) return amount / 1000 + "K"; if(amount >= 10000000 && amount < 999999999) return amount / 1000000 + "M"; if(amount >= 999999999) return "*"; else return "?"; }
So to add more staves, you'd have to edit the scripts of these interfaces.
TLDR; this functionality is part of a script that's attached to an interface.




