EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   client casting (https://www.eqemulator.org/forums/showthread.php?t=40344)

JimB_1958 01-20-2016 04:27 PM

client casting
 
This should be simple. But I'm stuck (Again)

I want to make a click in code item script that will cast a nuke or root etc on a targeted mob.

Tried variations of $client->Castspell and $client->Spellfinished and just can't get it to work.

make me feel stupid(er) please.

ghanja 01-20-2016 04:46 PM

Quote:

Originally Posted by JimB_1958 (Post 246607)
This should be simple. But I'm stuck (Again)

I want to make a click in code item script that will cast a nuke or root etc on a targeted mob.

Tried variations of $client->Castspell and $client->Spellfinished and just can't get it to work.

make me feel stupid(er) please.

Supply the actual implementation (code) within [ code ] and [ /code ] blocks please.

NatedogEZ 01-20-2016 04:51 PM

Here is a small example..

Code:

sub EVENT_ITEM_CLICK {
        my $target = $client->GetTarget();
        if ($target && $target->IsNPC() && !($target->GetOwnerID() && $entity_list->GetMobByID($target->GetOwnerID())->IsClient())) {  #Only cast on NPCs and ignore player pets
                $client->SpellFinished(982, $target);  #Cast Cazic Touch
        }
}


JimB_1958 01-20-2016 05:34 PM

Sorry ghanga... My code was trashed in frustration. But it was something like

Code:


sub EVENT_ITEM_CLICK {
 $client->SpellFinished(982, $targetid); 
}
                       
and
                               
sub EVENT_ITEM_CLICK {
 $client->CastSpell(982, $client->GetTarget(),11); 
}

I guess I was closer than I thought.

Natedog your example was spot on. Thanks a bunch


All times are GMT -4. The time now is 03:00 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.