I hardly ever release anything anymore. But I haven't seen this around yet and I found that to be so hilarious considering how easy it is to get this effect.
I don't care how you would add this. This is how I added it and it works perfectly fine. Also, if you still think using process for simple timers is bad, you're an idiot. (:
Alright.
After the tutorial, you will have this:
Video of Antifire potion effect.
Difficulty - 0/10
Assumed Knowledge - Common Sense
Classes Modified - NPC Class and client Class.
Test Bases - Battlescape (It's easy as shit to convert to another.)
What this does - It adds Antifire potions to the server, giving them the same special ability as the Anti-Dragon shield. It also adds a displayed tick in the quest tab to let the user know when he/she needs to drink another potion. You may choose to remove this if you wish.


First, open up your client class and declare this:
Now that you've declared the gut of this whole thing search for this:
Under that you should see:
Replace that with this:
Next, search for this:
Under it, add:
Alright, now that we've made the timer and the quest tab updater as I like to call it. We will now make the potions work.
Add this to the switch statement that handles your potions:
That enables you to drink them and sets the antifireTick to 500.
Save and close your client class.
Now we're going to make the potions have their special abilities.
Open up your NPC class and search for:
Replace that with this:
Repeat the above step once again.
Once you've replaced the above step twice, then find:
Replace that with:
Save and compile.
There are no bugs, nor any errors. I have tested this a shit ton. If there is something wrong, then it is something you did.
I do not care how you've done it, or how you think I should do it. It's done this way and it works just fine.
I don't care how you would add this. This is how I added it and it works perfectly fine. Also, if you still think using process for simple timers is bad, you're an idiot. (:
Alright.
After the tutorial, you will have this:
Video of Antifire potion effect.
Difficulty - 0/10
Assumed Knowledge - Common Sense
Classes Modified - NPC Class and client Class.
Test Bases - Battlescape (It's easy as shit to convert to another.)
What this does - It adds Antifire potions to the server, giving them the same special ability as the Anti-Dragon shield. It also adds a displayed tick in the quest tab to let the user know when he/she needs to drink another potion. You may choose to remove this if you wish.


First, open up your client class and declare this:
Code: [Select]
public int antifireTick = 0;Now that you've declared the gut of this whole thing search for this:
Code: [Select]
public void loadQuestTab() {Under that you should see:
Code: [Select]
changeText126("", 7334);Replace that with this:
Code: [Select]
if (antifireTick > 0) {
changeText126("@or1@Antifire Timer:", 7334);
} Next, search for this:
Code: [Select]
public void process() {Under it, add:
Code: [Select]
antifireTick--;
if (antifireTick > 0) {
changeText126("@or1@Antifire Timer: @gre@" + antifireTick, 7334);
} else {
changeText126("@or1@Antifire Timer: @red@0", 7334);
}
if (antifireTick == 0) {
sendMessage("Your Antifire potion effect has worn off, drink some more.");
}Alright, now that we've made the timer and the quest tab updater as I like to call it. We will now make the potions work.
Add this to the switch statement that handles your potions:
Code: [Select]
case 2452: //Antifire (4)
if (!duelRule[6]) {
if (drinkDelay > 0) {
break;
}
drinkDelay = 3;
itemUseDelay();
startAnimation(829, 0);
antifireTick = 500;
deleteItem(2452, GetItemSlot(2452), 1);
addItem(2454, 1);
} else {
sendMessage("Drinking has been disabled in this duel!");
}
break;
case 2454: //Antifire(3)
if (!duelRule[6]) {
if (drinkDelay > 0) {
break;
}
drinkDelay = 3;
itemUseDelay();
startAnimation(829, 0);
antifireTick = 500;
deleteItem(2454, GetItemSlot(2454), 1);
addItem(2456, 1);
} else {
sendMessage("Drinking has been disabled in this duel!");
}
break;
case 2456: //Antifire (2)
if (!duelRule[6]) {
if (drinkDelay > 0) {
break;
}
drinkDelay = 3;
itemUseDelay();
startAnimation(829, 0);
antifireTick = 500;
deleteItem(2456, GetItemSlot(2456), 1);
addItem(2458, 1);
} else {
sendMessage("Drinking has been disabled in this duel!");
}
break;
case 2458: //Antifire (1)
if (!duelRule[6]) {
if (drinkDelay > 0) {
break;
}
drinkDelay = 3;
itemUseDelay();
startAnimation(829, 0);
antifireTick = 500;
deleteItem(2458, GetItemSlot(2458), 1);
addItem(229, 1);
} else {
sendMessage("Drinking has been disabled in this duel!");
}
break;That enables you to drink them and sets the antifireTick to 500.
Save and close your client class.
Now we're going to make the potions have their special abilities.
Open up your NPC class and search for:
Code: [Select]
if (NpcType == 50 && p.playerEquipment[p.playerShield] == 1540)Replace that with this:
Code: [Select]
if (NpcType == 50 && p.playerEquipment[p.playerShield] == 1540 || NpcType == 50 && p.antifireTick > 0)Repeat the above step once again.
Once you've replaced the above step twice, then find:
Code: [Select]
if (p.playerEquipment[5] == 1540)Replace that with:
Code: [Select]
if (p.playerEquipment[5] == 1540 || p.antifireTick > 0)Save and compile.
There are no bugs, nor any errors. I have tested this a shit ton. If there is something wrong, then it is something you did.
I do not care how you've done it, or how you think I should do it. It's done this way and it works just fine.

















comments (0)
Post a Comment