forked from 2009Scape/Server
Familiar timer now only decreases if at zero summoning points
This change reduces the upkeep cost of Summoning, now you only need points or pouches, but not both.
This commit is contained in:
parent
e5e6006212
commit
a361915281
2 changed files with 10 additions and 3 deletions
|
|
@ -177,7 +177,9 @@ public abstract class Familiar extends NPC implements Plugin<Object> {
|
|||
if (pouchId == -1) {
|
||||
this.pointsPerTick = 0.0;
|
||||
} else {
|
||||
int drain = pouch.getLevelRequired() - pouch.getSummonCost() + 1;
|
||||
//int drain = pouch.getLevelRequired() - pouch.getSummonCost() + 1;
|
||||
// Snowscape: removing the initial drain and making it drain over the life of the familiar. Removing the +1 makes the final drain happen on the last tick of the familiar's life. That works for our new system, as the familiar timer won't start until that final tick happens.
|
||||
int drain = pouch.getLevelRequired();
|
||||
this.pointsPerTick = (double) drain / maximumTicks;
|
||||
}
|
||||
}
|
||||
|
|
@ -223,7 +225,10 @@ public abstract class Familiar extends NPC implements Plugin<Object> {
|
|||
|
||||
@Override
|
||||
public void handleTickActions() {
|
||||
ticks--;
|
||||
//Snowscape: only count down the familiar timer if summoning points are zero
|
||||
if (owner.getSkills().getLevel(Skills.SUMMONING) == 0) {
|
||||
ticks--;
|
||||
}
|
||||
fracDrain += pointsPerTick;
|
||||
if (fracDrain > 1.0 && ticks > 0) {
|
||||
fracDrain -= 1.0;
|
||||
|
|
|
|||
|
|
@ -187,10 +187,12 @@ public final class FamiliarManager {
|
|||
player.getPacketDispatch().sendMessage("You need a Summoning level of " + pouch.getLevelRequired() + " to summon this familiar.");
|
||||
return;
|
||||
}
|
||||
/* Snowscape: removing the drain on summon. This drain will instead be added to the gradual drain over the familiar's life.
|
||||
if (player.getSkills().getLevel(Skills.SUMMONING) < pouch.getSummonCost()) {
|
||||
player.getPacketDispatch().sendMessage("You need at least " + pouch.getSummonCost() + " Summoning points to summon this familiar.");
|
||||
return;
|
||||
}
|
||||
*/
|
||||
final int npcId = pouch.getNpcId();
|
||||
Familiar fam = !renew ? FAMILIARS.get(npcId) : familiar;
|
||||
if (fam == null) {
|
||||
|
|
@ -208,7 +210,7 @@ public final class FamiliarManager {
|
|||
if (!player.getInventory().remove(item)) {
|
||||
return;
|
||||
}
|
||||
player.getSkills().updateLevel(Skills.SUMMONING, -pouch.getSummonCost(), 0);
|
||||
//player.getSkills().updateLevel(Skills.SUMMONING, -pouch.getSummonCost(), 0);
|
||||
player.getSkills().addExperience(Skills.SUMMONING, pouch.getSummonExperience());
|
||||
if (!renew) {
|
||||
familiar = fam;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue