View Single Post
  #14  
Old 08-05-2004, 10:38 AM
Charmy
Discordant
 
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
Default

GAH! i didn't read your script. ok few questions, are you getting attacked by any mob? or do both mobs just stand there lookign stupid.
if you get attacked by one, but its the wrong one here is the problem. The quest::attack line causes the current mob to attack, not the mob that is spawns, what you need to do is add a line into the EVENT_SPAWN of the mob you want to attack. i.e.

Mob that is spawned:
Code:
sub EVENT_SPAWN
 {
   quest::attack($charid);
  }
now the problem is this, this mob won't have the character targeted when it spawns, so what you have to do is tell it what to target, sadly, there is no stock command in the quest sytem that tells mobs to target stuff via another mob, so there are two ways you can go about doing this. You can one, use corfuben's guide and make your own command to transfer the charid data to the other mob, if this is to difficult you can take the easier route which is to set a qglobal with the value of the $charid.

e.g.
Code:
sub EVENT_ITEM { 
if($itemcount{20368} == 1)
  { 
    quest::say("Hmmm. What's this? A note from that silly bard Baenar? I wasn't aware that those of his kind could write, much less read."); 
    quest::emote("lets out a deep laugh."); 
    quest::say("I see you do not share my sense of humor. Let's read it, shall we? Oh, no! She's dead? I knew that already, you fool. It was by my hand she died! Ooops! Did I let that slip out? Silly me. I guess I will have to kill you now!"); 
    quest::targlobal("VARCHARID",$charid,"D1",210,$charid,$zoneid); #note that i set mobid to 210, the number of the mob you are spawning, you will see why i did this in a moment.
    quest::spawn(12132,0,0,-10905,1249,210); 
   }
  }
This goes in the mob that you hand the note to.
(btw you might want to depop this mob if it is suppose to be him attacking you, in which case you just add the quest::depop command. but if this is the case you will want to make a copy of him in the mob database, as a seperate mob number. this way as you will see in the next script, when this mob normally pops on his timer, he won't try to attack someone on accident.)


then in the mob you are spawning.

in the mob you are spawning (mob 210 in this case):
Code:
sub EVENT_SPAWN
  {
    # i set $mobid to 210, so this mob would have access to the $VARCHARID in the qglobal table.
    quest::attack($VARCHARID); 
   }
sub EVENT_DEATH 
  { 
    quest::summonitem("20367"); 
   }
so what we have is, you hand in the item, the mob sets a variable in the databse equal to that of the current characters id. then it spawns this mob, which then reads the variable and attacks whatever the value of that variable is.

i hope this helps ya out, ask with any questions you have
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
Reply With Quote