tears of saedron remove stat runes

This commit is contained in:
2025-02-05 17:59:07 -06:00
parent ccdea6f970
commit 0681d3d116
3 changed files with 19 additions and 3 deletions
@@ -232,11 +232,13 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
if (pc == null || origin == null) {
return;
}
ItemBase runeBase = ItemBase.getItemBase(runeID);
//remove only if rune is discipline
if (runeID < 3001 || runeID > 3048) {
boolean discRune = runeBase.isDiscRune();
boolean statRune = runeBase.isStatRune();
if(!runeBase.isDiscRune() && !runeBase.isStatRune())
return;
}
//see if pc has rune
ArrayList<CharacterRune> runes = pc.getRunes();
@@ -576,6 +576,7 @@ public class VendorDialogMsg extends ClientNetMsg {
case 2520:
case 2521:
case 2523:
case 2525:
valid = true;
break;
}
+13
View File
@@ -164,6 +164,19 @@ public class CharacterRune extends AbstractGameObject {
runes.remove(runes.indexOf(rune));
CharacterSkill.calculateSkills(pc);
pc.applyBonuses();
if(ItemBase.getItemBase(rune.getRuneBaseID()) != null && ItemBase.getItemBase(rune.getRuneBaseID()).isStatRune()){
//handle point refund
int creationCost = 0;
for(RuneBaseAttribute attr : rune.runeBase.getAttrs()){
if(attr.getAttributeID() == MBServerStatics.RUNE_COST_ATTRIBUTE_ID){
creationCost = (int)attr.getModValue();
}
}
if(creationCost > 0){
pc.unusedStatPoints += creationCost;
pc.syncClient();
}
}
return true;
}
}