View Full Version : item cast help
Maceblade
07-18-2016, 12:47 PM
So basically I created an item where once clicked, it gives you an AA and poofs. Only problem is, item poofs just fine but grants no reward...
sub EVENT_ITEM_CLICK {
if($itemid == 1813){
quest::emote("You have Gained an AA!!");
$client->AddAAPoints(1);}
}
ghanja
07-18-2016, 02:19 PM
What type of item? Food/drink? (Sounds like it may be, since there is nothing in your code nuking an item). Is the code you submitted the complete code? What is the scripts filename (is it in your /quests/global/items/ ?) Scriptfileid for the item match that of the script filename?
Maceblade
07-18-2016, 07:12 PM
sorry, I copied the Halloween illusion script file and just altered it "script_13674.pl", also copied the halloween illusion item and just renamed it. The file name is script_8818.pl, the item number is 1813... I also created a "script_1813.pl" to see if that would work.
When I looked at the Halloween item, it did not look for a book or have any distinguishing remarks associated with its script path... im gonna check the food/drink thing now.
ghanja
07-18-2016, 08:01 PM
sorry, I copied the Halloween illusion script file and just altered it "script_13674.pl", also copied the halloween illusion item and just renamed it. The file name is script_8818.pl, the item number is 1813... I also created a "script_1813.pl" to see if that would work.
When I looked at the Halloween item, it did not look for a book or have any distinguishing remarks associated with its script path... im gonna check the food/drink thing now.
Well no, don't jump the gun, those were just questions, not rhetoric.
You said:
Only problem is, item poofs just fine but grants no reward
script_13674.pl is for the gauntlets/hammer of infusion, which has a NukeItem, and its an EVENT_ITEM_CLICK_CAST, rather than EVENT_ITEM_CLICK
So, I was curious, if the code you supplied, was the entire code you were using. And if the item you were basing the click event off of was a consumable (as I didnt see anything in the script to make a non-consumable "poof")
c0ncrete
07-18-2016, 09:38 PM
are there other scripted items that work from that folder? i ask because i'm finding item scripts in /quests/global/items in a current install.
ghanja
07-18-2016, 11:00 PM
are there other scripted items that work from that folder? i ask because i'm finding item scripts in /quests/global/items in a current install.
Yeah it's /quests/global/spells and /quests/global/items, I misspoke, though awaiting answers to other questions in hope to help out.
kimura
07-19-2016, 10:57 AM
make sure the item has the script file ID assigned to it
here is an example of one of mine
sub EVENT_ITEM_CLICK {
my $named = $client->GetName();
if($itemid == 132496 && $ulevel == 1) {
$client->NukeItem(132496);
$client->Message(327, "You have been boosted!");
quest::we(327, "$named has been boosted!!");
quest::level(70);
$client->Message(327, "Bam! Level 70!");
$client->SetAAPoints(1000);
$client->Message(327, "You now have 1000 AA points!");
} else {
$client->Message(315, "Nice try, you're too powerful to use this");
}
}
the script is script_7150.pl, so the item 132496 has to have the scriptfileid column in the items table = 7150
hope this helps
Maceblade
07-24-2016, 09:40 AM
Thanks Kim, I didn't realize the scriptidfile was a column until I looked at it through an old edit version. Thanks Man works flawless.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.