Set Race of NPC based on owner of instance?
Is there any way to set the race of an NPC based on the owner of an instance? (without having to keep crazy kinds of track of that kind of thing using global variables) .. I guess it can be done with some sort of global variable system though ... hmm
|
I can't seem to set a global variable...
Code:
quest::setglobal("newbrace_$instanceID", $raceid, 7,"H2"); |
. conjunctions don't work in this system. Try "Global: $glob"
|
still not working
Code:
instanceID: 39 raceid: 5 global: =\ |
And don't use quotes in global values: $qglobals{global_name}
Now that I'm reading your post better... I think you are overthinking this by using globals. You can create different versions of the zone, and then just use the quest system to determine the proper version based upon race. |
interesting idea.. but then I'd have to make a ton of copies of the zone with all the spawns/npcs in them .. hmm .. not sure how to do that either .. lol =\
i'll try it without the quotes .. is it ok though that a variable makes up part of the variable name? edit: looks like i found my answer .. this doesn't work.. crashes the perl script: Code:
my glob = $qglobals{newbrace_$instanceID}; |
That wouldn't work anyways with just glob ... it should be a variable $glob
|
errrr .. yeah it is $glob .. I just messed up retyping it in the post here
the problem is with using $instanceID as part of the variable name |
Yes, I understand. You are right, it would not work with a variable like that.
|
However, you can set the value before hand like this:
Code:
sub EVENT_SAY { |
Quote:
|
noob enters the world, goes to the loading zone, is immediately transferred to a new private instance created for them where they are welcomed by 2 NPCs that are of their same race.. they then go through kind of a trial.. so it could be annoying to write X different zone instances for each race.. unless there's some way to automate it / copy 1 instance to several..
so using global variables.. I figure that when I create the instance I save out the user's race and after I spawn the 2 welcoming NPCs I set their races based on the global variable I saved when creating the instance.. it should work? except I can't seem to save/read these global variables =\ |
The NPC must have qglobal set to 1 in the npc_types table in order for them to read the qglobal.
If you are only going to set 2 NPCs, you wouldn't need to do any of this. I would set up a player.pl file in the zone which modifies the race of the 2 NPCs based upon the player's race... |
Quote:
edit: hmm .. perhaps something as simple as using a proximity event on the mob? |
An example may be to do something like this:
player.pl Code:
sub EVENT_ENTERZONE { Code:
sub EVENT_SIGNAL { |
All times are GMT -4. The time now is 10:22 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.