View Single Post
  #1  
Old 11-23-2012, 01:17 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default Event_item_click

what's the difference between EVENT_ITEM_CLICK and EVENT_ITEM_CLICK_CAST? i understand that the former requires SoF+, but i'm not sure why the latter would lock up SoD.

i created a script_8556.pl for use with the bloodmoon pick axe while running some tests, and when i used EVENT_ITEM_CLICK_CAST instead of EVENT_ITEM_CLICK, i was stuck in "you can't use that command while casting" mode.

i hadn't altered anything in the database for the item in question, and it was working with the other event. does something else have to be set for the item's entry that i am unaware of?

this is what i was testing:
Code:
sub EVENT_ITEM_CLICK_CAST
{
    if ($itemid == 35096)
    {
        return if !validLoc();
        quest::doanim(87);
    }
}

my %testArea = (
    189 => [
        {
            x =>  125,
            y =>   48,
            z => -222
        },
        {
            x => -655,
            y => -428,
            z =>    2
        }
    ]
);

sub validLoc
{
    return 0 if !exists($testArea{$zoneid});
    foreach $loc (@{$testArea{$zoneid}}) {
        return 1 if (
            $loc->{'x'} == $client->GetX() &&
            $loc->{'y'} == $client->GetY() &&
            $loc->{'z'} == $client->GetZ()
        );
    }
    0;
}
Reply With Quote