Try this
- script AcidDemoHandler -1,{
// Define WoE castle maps
setarray .castle_maps$[0], "prtg_cas01", "prtg_cas02", "payg_cas01", "aldeg_cas01";
// Item IDs
set .acid_demo_box, 9001; // Replace 9001 with your custom Acid Demonstration Box ID
set .bottle_grenade, 7135;
set .acid_bottle, 7136;
// Acid Demonstration skill ID
set .acid_demo_skill, 294;
OnPCUseItemEvent:
// Check if the used item is the Acid Demonstration Box
if (getarg(0) == .acid_demo_box) {
// Verify if the player is inside a WoE castle map
if (getarraysize(.castle_maps$)) {
for (set .@i, 0; .@i < getarraysize(.castle_maps$); set .@i, .@i + 1) {
if (strcharinfo(3) == .castle_maps$[.@i]) {
// Allow use in WoE castle
skill .acid_demo_skill, 1; // Cast Acid Demonstration skill
end;
}
}
}
// Outside castle maps: cancel item use and show a message
dispbottom "The Acid Demonstration Box can only be used inside WoE castles.";
end;
}
// Check for regular item usage (Bottle Grenade and Acid Bottle)
if (getarg(0) == .bottle_grenade || getarg(0) == .acid_bottle) {
// Allow item usage everywhere
end;
}
end;
}
Save this script in your server's NPC scripts folder.
Reload the script using the @reloadscript command.
Test it inside and outside castle maps to ensure proper functionality.