Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2016, 04:27 PM
JimB_1958
Sarnak
 
Join Date: Mar 2013
Location: Springfield MO
Posts: 66
Default 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.
__________________
"We are all on the same team, and I think not enough people realize this."
- Leetsauce
Reply With Quote
  #2  
Old 01-20-2016, 04:46 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by JimB_1958 View Post
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.
Reply With Quote
  #3  
Old 01-20-2016, 04:51 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

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
	}
}
Reply With Quote
  #4  
Old 01-20-2016, 05:34 PM
JimB_1958
Sarnak
 
Join Date: Mar 2013
Location: Springfield MO
Posts: 66
Thumbs down

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
__________________
"We are all on the same team, and I think not enough people realize this."
- Leetsauce
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:25 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3