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 04-18-2015, 02:48 PM
JimB_1958
Sarnak
 
Join Date: Mar 2013
Location: Springfield MO
Posts: 66
Default Pet getting owner ID

I know I have seen this somewhere on forums, but I just can't find it.

I want to spawn a pet, and get the pet owner charID so I can reference a qglobal from that by charid

Any help?
__________________
"We are all on the same team, and I think not enough people realize this."
- Leetsauce
Reply With Quote
  #2  
Old 04-18-2015, 03:45 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

By reference from character ID, what do you mean?
Reply With Quote
  #3  
Old 04-18-2015, 05:07 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Same question as Krab. Did you mean something like:
Code:
$petowner = $entity_list->GetClientByID($mob->GetOwnerID());
If I goofed that up chLk it up to trying to type all that on an Android
Reply With Quote
  #4  
Old 04-18-2015, 06:12 PM
JimB_1958
Sarnak
 
Join Date: Mar 2013
Location: Springfield MO
Posts: 66
Default

I want to put code in a pet's event_spawn so that I can find out who the pet belongs to. Then have the pet target that character.

From there, I plan to pull a qglobal setting based on the client ID to manipulate pet race and the like. Not doable? Or is there a better way?
__________________
"We are all on the same team, and I think not enough people realize this."
- Leetsauce
Reply With Quote
  #5  
Old 04-18-2015, 06:16 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

It would be easier for the pet to signal the client and then in the client script you handle the pet stuff. Because you cannot actually access player-specific quest globals in an NPC script without making it a global with a type of 7 and making it unique using character name or something.
Reply With Quote
  #6  
Old 04-29-2015, 11:49 AM
JimB_1958
Sarnak
 
Join Date: Mar 2013
Location: Springfield MO
Posts: 66
Default

Well... I thought it would be easier yet to have client just signal the pet on zone change...

Code:
sub EVENT_ENTERZONE {
  my $pet_id = $client->GetPetID();
  if ($pet_id) {
    quest::settimer($pet_id, 3);
  }
}

sub EVENT_TIMER {
  quest::stoptimer($timer);
  $pet = $entity_list->GetNPCByID($timer);
  quest::signalwith($pet,0,1);
  $client->Message(15,"Petid is $pet");
}

Pet never gets the message. The client message tells me that $pet = SCALAR(04X...) or something of that nature.

Still lost at this point.
__________________
"We are all on the same team, and I think not enough people realize this."
- Leetsauce
Reply With Quote
  #7  
Old 04-29-2015, 01:34 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

/quest/global/global_npc.pl
Code:
sub EVENT_SPAWN {
	if ($npc->GetNPCTypeID() == <put pet NPC Type ID here>) {
		my $petowner = $entity_list->GetClientByID($npc->GetOwnerID());
		$petowner->Message(15, "You are my owner!");
	}
}
Seems I was dismissed entirely. It would be extremely helpful to just know what you're wanting to achieve, precisely.
Reply With Quote
  #8  
Old 04-29-2015, 01:51 PM
JimB_1958
Sarnak
 
Join Date: Mar 2013
Location: Springfield MO
Posts: 66
Default

I'm probably going about it all wrong but what I am trying to achieve is This:

Create a pet in the Datbase, with no particular race, texture, gender, or size. (Done)
Create a spell to summon that pet (Done)
Create an item that has a clicky to summon the pet. (Done)

Now, I would like to save 4 values per client for the pets race, texture, gender, and size and set these values each time the client zones.

Basically a custom look to pets that player sets from a "Pet Merchant"

I can have the pet change the values in EVENT_SAY and they are pulled from qglobals, just cannot figure out how to do it without client intervention after the initial contact with the Pet Merchant.
__________________
"We are all on the same team, and I think not enough people realize this."
- Leetsauce
Reply With Quote
  #9  
Old 04-29-2015, 02:22 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

I think I follow now.

What I would do is create a bitmask using the four pet traits (race, gender, size, etc.), perhaps, depending on how many options you plan to give the PC.

Saving that with something like:

Code:
my $petowner = $entity_list->GetClientByID($npc->GetOwnerID());
my $racekey = "cp".$npc->GetNPCTypeID().$petowner->CharacterID()."";
Where the value for the key $racekey created stores the bitmask value. I wish I werent on my way out, I started my replies thinking all you wanted was to find the owner's CharID. There are some talented coders here, I'm thinking one will reply before I get back, if not, I'll give example of how I would go about it.

But for now, you atleast have an idea of how to find the pet owner's CharID.
Reply With Quote
  #10  
Old 04-29-2015, 04:24 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Code:
	my %pethash = (
		"Aviak"	=>		{
							race => 13,
							texturechoices => [0..4],
							genderchoices => [2],
						},
		"Gorilla"	=>	{
							race => 41,
							texturechoices => [0..2],
							genderchoices => [2],
						},
		"Werewolf" =>	{
							race => 14,
							texturechoices => [0],
							genderchoices => [2],
						},
	);
Aside from the above hash, you may need to open up your GlobalLoad depending upon what models you plan to allow. Use the above hash only as an example. Personally, I would give them only particular options (i.e. race 41, gender 2, texture 2) and then maybe ask for size (allowing on a certain range).

I forget who made the original Races.pl script (forgive me whoever), but, here it is modified a little.

Code:
 %racelist = (
0=> ["UNKNOWN RACE"],
1=> ["Human (G)"],
2=> ["Barbarian (G)"],
3=> ["Erudite (G)"],
4=> ["Wood Elf (G)"],
5=> ["High Elf (G)"],
6=> ["Dark Elf (G)"],
7=> ["Half Elf (G)"],
8=> ["Dwarf (G)"],
9=> ["Troll (G)"],
10=> ["Ogre (G)"],
11=> ["Halfling (G)"],
12=> ["Gnome (G)"],
13=> ["Aviak"],
14=> ["Werewolf (G)"],
15=> ["Brownie"],
16=> ["Centaur"],
17=> ["Golem"],
18=> ["Giant"],
19=> ["Trakanon"],
20=> ["Venril Sathir"],
21=> ["Evil Eye"],
22=> ["Beetle"],
23=> ["Kerran"],
24=> ["Fish"],
25=> ["Fairy"],
26=> ["Froglok (G)"],
27=> ["Froglok (T:0:1) (G)"],
28=> ["Fungusman"],
29=> ["Gargoyle"],
30=> ["Gasbag"],
31=> ["Gelatinous Cube (G)"],
32=> ["Ghost"],
33=> ["Ghoul"],
34=> ["Bat"],
35=> ["Eel"],
36=> ["Rat"],
37=> ["Snake"],
38=> ["Spider"],
39=> ["Gnoll"],
40=> ["Goblin"],
41=> ["Gorilla"],
42=> ["Wolf (T:0:1:2:3) (G)"],
43=> ["Bear (T:0:1:2) (G)"],
44=> ["Guard"],
45=> ["Demi Lich"],
46=> ["Imp (G)"],
47=> ["Griffin"],
48=> ["Kobold"],
49=> ["Dragon"],
50=> ["Lion"],
51=> ["Lizard Man (T:0:1) (G)"],
52=> ["Mimic"],
53=> ["Minotaur"],
54=> ["Orc"],
55=> ["Beggar"],
56=> ["Pixie"],
57=> ["Drachnid"],
58=> ["Solusek Ro (G)"],
59=> ["Goblin"],
60=> ["Skeleton (G)"],
61=> ["Shark"],
62=> ["Tunare (G)"],
63=> ["Tiger (G)"],
64=> ["Treant"],
65=> ["Vampire"],
66=> ["Rallos Zek (T:0:1) (G)"],
67=> ["Human"],
68=> ["Tentacle Terror"],
69=> ["Will-O-Wisp"],
70=> ["Zombie"],
71=> ["Human"],
72=> ["Ship"],
73=> ["Launch"],
74=> ["Piranha"],
75=> ["Elemental (T:0:1:2:3) (G)"],
76=> ["Puma"],
77=> ["Dark Elf"],
78=> ["Erudite"],
79=> ["Bixie"],
80=> ["Reanimated Hand"],
81=> ["Halfling"],
82=> ["Scarecrow (G)"],
83=> ["Skunk"],
84=> ["Snake Elemental"],
85=> ["Spectre (G)"],
86=> ["Sphinx"],
87=> ["Armadillo"],
88=> ["Clockwork Gnome"],
89=> ["Drake (T:0:1:2:3) (G)"],
90=> ["Barbarian"],
91=> ["Alligator (T:0:1) (G)"],
92=> ["Troll"],
93=> ["Ogre"],
94=> ["Dwarf"],
95=> ["Cazic Thule (T:0:1) (G)"],
96=> ["Cockatrice"],
97=> ["Daisy Man"],
98=> ["Vampire"],
99=> ["Amygdalan"],
100=> ["Dervish"],
101=> ["Efreeti"],
102=> ["Tadpole"],
103=> ["Kedge"],
104=> ["Leech"],
105=> ["Swordfish"],
106=> ["Guard"],
107=> ["Mammoth"],
108=> ["Eye (G)"],
109=> ["Wasp"],
110=> ["Mermaid"],
111=> ["Harpy"],
112=> ["Guard"],
113=> ["Drixie"],
114=> ["Ghost Ship"],
115=> ["Clam"],
116=> ["Seahorse"],
117=> ["Ghost"],
118=> ["Ghost"],
119=> ["Sabertooth"],
120=> ["Wolf (T:0:1:2:3) (G)"],
121=> ["Gorgon"],
122=> ["Dragon"],
123=> ["Innoruuk (G)"],
124=> ["Unicorn"],
125=> ["Pegasus"],
126=> ["Djinn"],
127=> ["Invisible Man (G)"],
128=> ["Iksar (G)"],
129=> ["Scorpion"],
130=> ["Vah Shir (G)"],
131=> ["Sarnak"],
132=> ["Draglock"],
133=> ["Drolvarg"],
134=> ["Mosquito (G)"],
135=> ["Rhinoceros"],
136=> ["Xalgoz"],
137=> ["Goblin (T:0:1:2) (G)"],
138=> ["Yeti"],
139=> ["Iksar"],
140=> ["Giant"],
141=> ["Boat (G)"],
142=> ["UNKNOWN RACE"],
143=> ["UNKNOWN RACE (G) (This is a tree model)"],
144=> ["Burynai"],
145=> ["Goo"],
146=> ["Sarnak Spirit"],
147=> ["Iksar Spirit"],
148=> ["Fish"],
149=> ["Scorpion"],
150=> ["Erollisi (G)"],
151=> ["Tribunal (G)"],
152=> ["Bertoxxulous"],
153=> ["Bristlebane (G)"],
154=> ["Fay Drake"],
155=> ["Undead Sarnak"],
156=> ["Ratman"],
157=> ["Wyvern"],
158=> ["Wurm"],
159=> ["Devourer"],
160=> ["Iksar Golem"],
161=> ["Undead Iksar (G)"],
162=> ["Man-Eating Plant"],
163=> ["Raptor (G)"],
164=> ["Sarnak Golem"],
165=> ["Dragon"],
166=> ["Animated Hand"],
167=> ["Succulent"],
168=> ["Holgresh"],
169=> ["Brontotherium"],
170=> ["Snow Dervish"],
171=> ["Dire Wolf"],
172=> ["Manticore"],
173=> ["Totem"],
174=> ["Ice Spectre"],
175=> ["Enchanted Armor"],
176=> ["Snow Rabbit"],
177=> ["Walrus"],
178=> ["Geonid"],
179=> ["UNKNOWN RACE"],
180=> ["UNKNOWN RACE"],
181=> ["Yakkar"],
182=> ["Faun"],
183=> ["Coldain"],
184=> ["Dragon"],
185=> ["Hag"],
186=> ["Hippogriff"],
187=> ["Siren"],
188=> ["Giant"],
189=> ["Giant"],
190=> ["Othmir"],
191=> ["Ulthork"],
192=> ["Dragon"],
193=> ["Abhorrent"],
194=> ["Sea Turtle"],
195=> ["Dragon"],
196=> ["Dragon"],
197=> ["Ronnie Test"],
198=> ["Dragon"],
199=> ["Shik'Nar (G)"],
200=> ["Rockhopper"],
201=> ["Underbulk"],
202=> ["Grimling"],
203=> ["Worm"],
204=> ["Evan Test"],
205=> ["Shadel"],
206=> ["Owlbear"],
207=> ["Rhino Beetle"],
208=> ["Vampire"],
209=> ["Earth Elemental (G)"],
210=> ["Air Elemental (G)"],
211=> ["Water Elemental (G)"],
212=> ["Fire Elemental (G)"],
213=> ["Wetfang Minnow"],
214=> ["Thought Horror"],
215=> ["Tegi"],
216=> ["Horse (G)"],
217=> ["Shissar"],
218=> ["Fungal Fiend"],
219=> ["Vampire"],
220=> ["Stonegrabber"],
221=> ["Scarlet Cheetah"],
222=> ["Zelniak"],
223=> ["Lightcrawler"],
224=> ["Shade"],
225=> ["Sunflower"],
226=> ["Sun Revenant"],
227=> ["Shrieker"],
228=> ["Galorian"],
229=> ["Netherbian"],
230=> ["Akheva"],
231=> ["Grieg Veneficus"],
232=> ["Sonic Wolf"],
233=> ["Ground Shaker"],
234=> ["Vah Shir Skeleton"],
235=> ["Wretch (G)"],
236=> ["Seru"],
237=> ["Recuso"],
238=> ["Vah Shir"],
239=> ["Guard"],
240=> ["Teleport Man"],
241=> ["Werewolf"],
242=> ["Nymph"],
243=> ["Dryad"],
244=> ["Treant"],
245=> ["Fly"],
246=> ["Tarew Marr"],
247=> ["Solusek Ro"],
248=> ["Clockwork Golem"],
249=> ["Clockwork Brain"],
250=> ["Banshee"],
251=> ["Guard of Justice"],
252=> ["Mini POM (G)"],
253=> ["Diseased Fiend"],
254=> ["Solusek Ro Guard"],
255=> ["Bertoxxulous"],
256=> ["The Tribunal"],
257=> ["Terris Thule"],
258=> ["Vegerog"],
259=> ["Crocodile"],
260=> ["Bat"],
261=> ["Hraquis"],
262=> ["Tranquilion"],
263=> ["Tin Soldier"],
264=> ["Nightmare Wraith"],
265=> ["Malarian"],
266=> ["Knight of Pestilence"],
267=> ["Lepertoloth"],
268=> ["Bubonian"],
269=> ["Bubonian Underling"],
270=> ["Pusling"],
271=> ["Water Mephit"],
272=> ["Stormrider"],
273=> ["Junk Beast"],
274=> ["Broken Clockwork"],
275=> ["Giant Clockwork"],
276=> ["Clockwork Beetle"],
277=> ["Nightmare Goblin"],
278=> ["Karana"],
279=> ["Blood Raven"],
280=> ["Nightmare Gargoyle"],
281=> ["Mouth of Insanity"],
282=> ["Skeletal Horse"],
283=> ["Saryrn"],
284=> ["Fennin Ro"],
285=> ["Tormentor"],
286=> ["Soul Devourer"],
287=> ["Nightmare"],
288=> ["Rallos Zek"],
289=> ["Vallon Zek"],
290=> ["Tallon Zek"],
291=> ["Air Mephit"],
292=> ["Earth Mephit"],
293=> ["Fire Mephit"],
294=> ["Nightmare Mephit"],
295=> ["Zebuxoruk"],
296=> ["Mithaniel Marr"],
297=> ["Undead Knight"],
298=> ["The Rathe"],
299=> ["Xegony"],
300=> ["Fiend"],
301=> ["Test Object"],
302=> ["Crab"],
303=> ["Phoenix"],
304=> ["Dragon"],
305=> ["Bear"],
306=> ["Giant"],
307=> ["Giant"],
308=> ["Giant"],
309=> ["Giant"],
310=> ["Giant"],
311=> ["Giant"],
312=> ["Giant"],
313=> ["War Wraith"],
314=> ["Wrulon"],
315=> ["Kraken"],
316=> ["Poison Frog"],
317=> ["Nilborien"],
318=> ["Valorian"],
319=> ["War Boar"],
320=> ["Efreeti"],
321=> ["War Boar"],
322=> ["Valorian"],
323=> ["Animated Armor (G)"],
324=> ["Undead Footman"],
325=> ["Rallos Zek Minion"],
326=> ["Arachnid"],
327=> ["Crystal Spider"],
328=> ["Zebuxoruk's Cage"],
329=> ["BoT Portal"],
330=> ["Froglok (G)"],
331=> ["Troll"],
332=> ["Troll"],
333=> ["Troll"],
334=> ["Ghost"],
335=> ["Pirate"],
336=> ["Pirate"],
337=> ["Pirate"],
338=> ["Pirate"],
339=> ["Pirate"],
340=> ["Pirate"],
341=> ["Pirate"],
342=> ["Pirate"],
343=> ["Frog"],
344=> ["Troll Zombie"],
345=> ["Luggald"],
346=> ["Luggald"],
347=> ["Luggalds"],
348=> ["Drogmore (G)"],
349=> ["Froglok Skeleton"],
350=> ["Undead Froglok"],
351=> ["Knight of Hate"],
352=> ["Arcanist of Hate"],
353=> ["Veksar"],
354=> ["Veksar"],
355=> ["Veksar"],
356=> ["Chokidai (G)"],
357=> ["Undead Chokidai"],
358=> ["Undead Veksar"],
359=> ["Vampire"],
360=> ["Vampire"],
361=> ["Rujarkian Orc"],
362=> ["Bone Golem"],
363=> ["Synarcana"],
364=> ["Sand Elf"],
365=> ["Vampire"],
366=> ["Rujarkian Orc"],
367=> ["Skeleton (G)"],
368=> ["Mummy (G)"],
369=> ["Goblin"],
370=> ["Insect"],
371=> ["Froglok Ghost (G)"],
372=> ["Dervish"],
373=> ["Shade"],
374=> ["Golem (G)"],
375=> ["Evil Eye"],
376=> ["Box"],
377=> ["Barrel"],
378=> ["Chest (G)"],
379=> ["Vase"],
380=> ["Table"],
381=> ["Weapon Rack"],
382=> ["Coffin"],
383=> ["Bones"],
384=> ["Jokester (G)"],
385=> ["Nihil"],
386=> ["Trusik"],
387=> ["Stone Worker"],
388=> ["Hynid"],
389=> ["Turepta (G)"],
390=> ["Cragbeast"],
391=> ["Stonemite"],
392=> ["Ukun"],
393=> ["Ixt"],
394=> ["Ikaav (G)"],
395=> ["Aneuk"],
396=> ["Kyv"],
397=> ["Noc"],
398=> ["Ra`tuk"],
399=> ["Taneth"],
400=> ["Huvul"],
401=> ["Mutna"],
402=> ["Mastruq (G)"],
403=> ["Taelosian"],
404=> ["Discord Ship"],
405=> ["Stone Worker (G)"],
406=> ["Mata Muram"],
407=> ["Lightning Warrior (G)"],
408=> ["Succubus (G)"],
409=> ["Bazu (G)"],
410=> ["Feran"],
411=> ["Pyrilen (G)"],
412=> ["Chimera"],
413=> ["Dragorn (G)"],
414=> ["Murkglider"],
415=> ["Rat (G)"],
416=> ["Bat (G)"],
417=> ["Gelidran (G)"],
418=> ["Discordling"],
419=> ["Girplan (G)"],
420=> ["Minotaur"],
421=> ["Dragorn Box"],
422=> ["Runed Orb"],
423=> ["Dragon Bones"],
424=> ["Muramite Armor Pile"],
425=> ["Crystal Shard"],
426=> ["Portal"],
427=> ["Coin Purse"],
428=> ["Rock Pile"],
429=> ["Murkglider Egg Sack"],
430=> ["Drake"],
431=> ["Dervish"],
432=> ["Drake"],
433=> ["Goblin (G)"],
434=> ["Kirin (G)"],
435=> ["Dragon"],
436=> ["Basilisk (G)"],
437=> ["Dragon"],
438=> ["Dragon"],
439=> ["Puma (G)"],
440=> ["Spider (G)"],
441=> ["Spider Queen"],
442=> ["Animated Statue"],
443=> ["UNKNOWN RACE"],
444=> ["UNKNOWN RACE"],
445=> ["Dragon Egg"],
446=> ["Dragon Statue"],
447=> ["Lava Rock"],
448=> ["Animated Statue"],
449=> ["Spider Egg Sack"],
450=> ["Lava Spider"],
451=> ["Lava Spider Queen"],
452=> ["Dragon"],
453=> ["Giant"],
454=> ["Werewolf (G)"],
455=> ["Kobold (G)"],
456=> ["Sporali (G)"],
457=> ["Gnomework (G)"],
458=> ["Orc (G)"],
459=> ["Corathus"],
460=> ["Coral"],
461=> ["Drachnid"],
462=> ["Drachnid Cocoon"],
463=> ["Fungus Patch"],
464=> ["Gargoyle (G)"],
465=> ["Witheran"],
466=> ["Dark Lord"],
467=> ["Shiliskin (G)"],
468=> ["Snake (G)"],
469=> ["Evil Eye (G)"],
470=> ["Minotaur (G)"],
471=> ["Zombie (G)"],
472=> ["Clockwork Boar (G)"],
473=> ["Fairy (G)"],
474=> ["Witheran"],
475=> ["Air Elemental"],
476=> ["Earth Elemental"],
477=> ["Fire Elemental"],
478=> ["Water Elemental"],
479=> ["Alligator"],
480=> ["Bear"],
481=> ["Scaled Wolf"],
482=> ["Wolf"],
483=> ["Spirit Wolf"],
484=> ["Skeleton"],
485=> ["Spectre (G)"],
486=> ["Bolvirk"],
487=> ["Banshee"],
488=> ["Banshee"],
489=> ["Elddar"],
490=> ["Forest Giant"],
491=> ["Bone Golem (G)"],
492=> ["Horse (G)"],
493=> ["Pegasus"],
494=> ["Shambling Mound"],
495=> ["Scrykin (G)"],
496=> ["Treant (G)"],
497=> ["Vampire"],
498=> ["Ayonae Ro"],
499=> ["Sullon Zek"],
500=> ["Banner"],
501=> ["Flag"],
502=> ["Rowboat"],
503=> ["Bear Trap (G)"],
504=> ["Clockwork Bomb"],
505=> ["Dynamite Keg"],
506=> ["Pressure Plate"],
507=> ["Puffer Spore"],
508=> ["Stone Ring (G)"],
509=> ["Root Tentacle"],
510=> ["Runic Symbol (G)"],
511=> ["Saltpetter Bomb"],
512=> ["Floating Skull (G)"],
513=> ["Spike Trap (G)"],
514=> ["Totem (G)"],
515=> ["Web"],
516=> ["Wicker Basket"],
517=> ["Nightmare/Unicorn (G)"],
518=> ["Horse (G)"],
519=> ["Nightmare/Unicorn (G)"],
520=> ["Bixie (G)"],
521=> ["Centaur (G)"],
522=> ["Drakkin (G)"],
523=> ["Giant"],
524=> ["Gnoll (G)"],
525=> ["Griffin"],
526=> ["Giant Shade"],
527=> ["Harpy (G)"],
528=> ["Mammoth"],
529=> ["Satyr (G)"],
530=> ["Dragon (G)"],
531=> ["Dragon"],
532=> ["Dyn'Leth"],
533=> ["Boat"],
534=> ["Weapon Rack"],
535=> ["Armor Rack"],
536=> ["Honey Pot"],
537=> ["Jum Jum Bucket"],
538=> ["Toolbox"],
539=> ["Stone Jug"],
540=> ["Small Plant"],
541=> ["Medium Plant"],
542=> ["Tall Plant"],
543=> ["Wine Cask"],
544=> ["Elven Boat"],
545=> ["Gnomish Boat"],
546=> ["Barrel Barge Ship"],
547=> ["Goo"],
548=> ["Goo"],
549=> ["Goo (G)"],
550=> ["Merchant Ship"],
551=> ["Pirate Ship"],
552=> ["Ghost Ship"],
553=> ["Banner (G)"],
554=> ["Banner (G)"],
555=> ["Banner (G)"],
556=> ["Banner (G)"],
557=> ["Banner (G)"],
558=> ["Aviak (G)"],
559=> ["Beetle (G)"],
560=> ["Gorilla"],
561=> ["Kedge (G)"],
562=> ["Kerran"],
563=> ["Shissar (G)"],
564=> ["Siren (G)"],
565=> ["Sphinx"],
566=> ["Human"],
567=> ["Campfire (G)"],
568=> ["Brownie"],
569=> ["Dragon"],
570=> ["Exoskeleton (G)"],
571=> ["Ghoul"],
572=> ["Clockwork Guardian"],
573=> ["Mantrap"],
574=> ["Minotaur (G)"],
575=> ["Scarecrow (G)"],
576=> ["Shade"],
577=> ["Rotocopter (G)"],
578=> ["Tentacle Terror (G)"],
579=> ["Wereorc"],
580=> ["Worg (G)"],
581=> ["Wyvern (G)"],
582=> ["Chimera (G)"],
583=> ["Kirin (G)"],
584=> ["Puma (G)"],
585=> ["Boulder"],
586=> ["Banner (G)"],
587=> ["Elven Ghost"],
588=> ["Human Ghost"],
589=> ["Chest"],
590=> ["Chest"],
591=> ["Crystal"],
592=> ["Coffin"],
593=> ["Guardian CPU"],
594=> ["Worg (G)"],
595=> ["Mansion"],
596=> ["Floating Island"],
597=> ["Cragslither (G)"],
598=> ["Wrulon (G)"],
599=> ["Spell Particle 1"],
600=> ["Invisible Man of Zomm"],
601=> ["Robocopter of Zomm (G)"],
602=> ["Burynai"],
603=> ["Frog"],
604=> ["Dracolich"],
605=> ["Iksar Ghost"],
606=> ["Iksar Skeleton (G)"],
607=> ["Mephit"],
608=> ["Muddite (G)"],
609=> ["Raptor (G)"],
610=> ["Sarnak (G)"],
611=> ["Scorpion (G)"],
612=> ["Tsetsian"],
613=> ["Wurm (G)"],
614=> ["Nekhon (G)"],
615=> ["Hydra Crystal (G)"],
616=> ["Crystal Sphere"],
617=> ["Gnoll"],
618=> ["Sokokar"],
619=> ["Stone Pylon"],
620=> ["Demon Vulture (G)"],
621=> ["Wagon"],
622=> ["God of Discord"],
623=> ["Feran Mount (G)"],
624=> ["Ogre NPC - Male"],
625=> ["Sokokar Mount (G)"],
626=> ["Giant (Rallosian mats)"],
627=> ["Sokokar (w saddle) (G)"],
628=> ["10th Anniversary Banner (G)"],
629=> ["10th Anniversary Cake (G)"],
630=> ["Wine Cask (G)"],
631=> ["Hydra Mount (G)"],
632=> ["Hydra NPC"],
633=> ["Wedding Flowers (G)"],
634=> ["Wedding Arbor (G)"],
635=> ["Wedding Altar (G)"],
636=> ["Powder Keg"],
637=> ["Apexus"],
638=> ["Bellikos (G)"],
639=> ["Brell's First Creation"],
640=> ["Brell"],
641=> ["Crystalskin Ambuloid"],
642=> ["Cliknar Queen"],
643=> ["Cliknar Soldier (G)"],
644=> ["Cliknar Worker (G)"],
645=> ["Coldain"],
646=> ["Coldain"],
647=> ["Crystalskin Sessiloid (G)"],
648=> ["Genari"],
649=> ["Gigyn"],
650=> ["Greken - Young Adult"],
651=> ["Greken - Young"],
652=> ["Cliknar Mount (G)"],
653=> ["Telmira (G)"],
654=> ["Spider Mount (G)"],
655=> ["Bear Mount (G)"],
656=> ["Rat Mount - Mystery Race"],
657=> ["Sessiloid Mount (G)"],
658=> ["Morell Thule"],
659=> ["Marionette (G)"],
660=> ["Book Dervish"],
661=> ["Topiary Lion"],
662=> ["Rotdog"],
663=> ["Amygdalan (G)"],
664=> ["Sandman"],
665=> ["Grandfather Clock (T:0:1:2) (G)"],
666=> ["Gingerbread Man (T:0:1) (G)"],
667=> ["Royal Guard"],
668=> ["Rabbit (T:0-7) (G)"],
669=> ["Blind Dreamer"],
670=> ["Cazic Thule (T:0:1) (G)"],
671=> ["Topiary Lion Mount (T:0:1:2) (G)"],
672=> ["Rot Dog Mount (T:0:1:2) (G)"],
673=> ["Goral Mount (T:0:1:2) (G)"],
674=> ["Selyrah Mount (T:0-5) (G)"],
675=> ["Sclera Mount - Mystery Race"],
676=> ["Braxi Mount (T:0-6) (G)"],
677=> ["Kangon Mount (T:0:1:2:3) (G)"],
678=> ["Erudite"],
679=> ["Wurm Mount (T:0-6) (G)"],
680=> ["Raptor Mount (T:0:1:2:3) (G)"],
681=> ["Invisible Man (G)"],
682=> ["Whirligig (G)"],
683=> ["Gnomish Balloon (T:0:1) (G)"],
684=> ["Gnomish Rocket Pack (G)"],
685=> ["Gnomish Hovering Transport (G)"],
686=> ["Selyrah"],
687=> ["Goral"],
688=> ["Braxi"],
689=> ["Kangon (t:0:1:2:3)"],
690=> ["Invisible Man"],
691=> ["Floating Tower"],
692=> ["Explosive Cart"],
693=> ["Blimp Ship"],
694=> ["Tumbleweed (G)"],
695=> ["Alaran (T:0-25)"],
696=> ["Swinetor (T:0:1:2:3) (G)"],
697=> ["Triumvirate (T:0:1)"],
698=> ["Hadal (T:0:1:2:3) (G)"],
699=> ["Hovering Platform"],
700=> ["Parasitic Scavenger"],
701=> ["Grendlaen (T:0:1:2)"],
702=> ["Ship in a Bottle (T:0:1) (G)"],
703=> ["Alaran Sentry Stone (T:0:1:2)"],
704=> ["Dervish"],
705=> ["Regeneration Pool (G)"],
706=> ["Teleportation Stand (G)"],
707=> ["Relic Case (T:0:1:2:3=>"],
708=> ["Alaran Ghost (T:0:1) (G)"],
709=> ["Skystrider (T:0-12) (G)"],
710=> ["Water Spout"],
711=> ["Aviak Pull Along (T:0:1) (G)"],
712=> ["Gelatinous Cube"],
713=> ["Cat"],
714=> ["Elk Head (G)"],
715=> ["Holgresh (T:0:1:2:(G)"],
716=> ["Beetle (T:0:1:2:3)"],
717=> ["Vine Maw (T:0:1)"],
718=> ["Ratman (T:0:1:2) (G)"],
719=> ["Fallen Knight (T:0:1:2:3) (G)"],
720=> ["Flying Carpet (G)"],
721=> ["Carrier Hand(G)"],
722=> ["Akheva"],
723=> ["Servant of Shadow"],
724=> ["Luclin"]
);

sub EVENT_SAY {
	
	my $next = quest::saylink("Next",1);
	my $back = quest::saylink("Back",1);
	my $gender = quest::saylink("Gender",1);
	my $texture = quest::saylink("Texture",1);
	my $stats = quest::saylink("Current",1);
	
	
	if($text=~/hail/i) {
		$client->Message(315, "Command List:");
		$client->Message(315, "[$stats] -- [$texture] -- [$gender] -- [$back] -- [$next]");
		$client->Message(315, "Or type ## to jump to that race");
	}
	elsif ($text=~/next/i) {
		$npc->SetRace($npc->CastToMob->GetRace()+1);
		my $current = $npc->GetRace();
		quest::shout("Now displaying race -$current- $racelist{$current}[0]");
		$npc->SurName($current);
	}
	elsif($text=~/back/i) {
		$npc->SetRace($npc->CastToMob->GetRace()-1);
		my $current = $npc->GetRace();
		quest::shout("Now displaying race -$current- $racelist{$current}[0]");
	}
	elsif($text=~/gender/i) {
		if ($npc->CastToMob->GetGender() == 0) {
			$npc->SetGender($npc->CastToMob->GetGender()+1);
			quest::shout("Gender 1");
		}
		elsif($npc->CastToMob->GetGender() == 1) {
			$npc->SetGender($npc->CastToMob->GetGender()+1);
			quest::shout("Gender 2");
		}
		elsif($npc->CastToMob->GetGender() == 2) {
			$npc->SetGender(0);
			quest::shout("Gender 0");
		}
	}
	elsif($text=~/reset/i) {
		$npc->SetRace(1);
		my $current = $npc->CastToMob->GetRace();
		quest::shout("Now displaying race -$current- $racelist{$current}[0]");
	}
	elsif($text=~/texture/i) {
		if ($npc->GetTexture() == 0) {
			$npc->SetTexture(1);
			quest::shout("Texture 1");
		}
		elsif ($npc->GetTexture() == 1) {
			$npc->SetTexture(2);
			quest::shout("Texture 2");
		}
		elsif ($npc->GetTexture() == 2) {
			$npc->SetTexture(3);
			quest::shout("Texture 3");
		}
		elsif ($npc->GetTexture() == 3) {
			$npc->SetTexture(4);
			quest::shout("Texture 4");
		}
		elsif ($npc->GetTexture() == 4) {
			$npc->SetTexture(5);
			quest::shout("Texture 5");
		}
		elsif ($npc->GetTexture() == 5) {
			$npc->SetTexture(0);
			quest::shout("Texture 0");
		}
		elsif ($npc->GetTexture() == 255) {
			$npc->SetTexture(0);
			quest::shout("Texture 0");
		}
	}
	elsif($text=~/current/i) {
		my $current = $npc->CastToMob->GetRace();
		MM("Race Name: ".$racelist{$current}[0]." -- Race ID: ".$npc->GetRace()." -- Gender: ".$npc->GetGender()." -- Texture: ".$npc->GetTexture()."");
		$client->Message(315, "Race Name: ".$racelist{$current}[0]." -- Race ID: ".$npc->GetRace()." -- Gender: ".$npc->GetGender()." -- Texture: ".$npc->GetTexture()."");
	}
	else {
		if($text=~/^[0-9]+$/) {
			$npc->SetRace($text);
			my $current = $npc->CastToMob->GetRace();
			quest::shout("Now displaying race -$current- $racelist{$current}[0]");
		}
	}
}

sub MM{
	my $client = plugin::val('$client');
	$Text = $_[0];
	my ($client_mess) = $Text =~ s/clientmessage//g;
	my ($instant) = $Text =~ s/instant//g;
	if($instant){ $client->SendMarqueeMessage(15, 510, 1, 1, 3000,  $Text);  }
	else{ $client->SendMarqueeMessage(15, 510, 1, 100, 3000,  $Text); }
	if($client_mess){ $client->Message(15, $Text); }
}
So again, I'd limit to choices.

White Gorilla = race 41 gender 2 texture 2
Undead Gorilla = race 41 gender 2 texture 1

Then build a hash something like:

Code:
my %pethash = (
	1	=>	{
				name => "White Gorilla",
				race => 41,
				texture => 2,
				gender => 2,
			},
	2	=>	{
				name => "Undead Gorilla",
				race => 41,
				texture => 1,
				gender => 2,
			},
);
Decide upon which direction you want to go (as far as choices, which while nice, limitations is sometimes nicer from an amount of coding standpoint).

With the latter method (offering choices) it would also simplify things a bit when it comes to the qglobal(s) used.

Last edited by ghanja; 04-29-2015 at 04:31 PM.. Reason: copy paste fail
Reply With Quote
  #11  
Old 04-29-2015, 04:49 PM
JimB_1958
Sarnak
 
Join Date: Mar 2013
Location: Springfield MO
Posts: 66
Default

Thanks ghanja! This looks great and I'm sure will get me going in the right direction.

I do plan to limit it to a few races at first, and add to it later. As for sizes, I thought I would set that value myself as well. I plan to bring tiny dragons into this as well.
__________________
"We are all on the same team, and I think not enough people realize this."
- Leetsauce
Reply With Quote
  #12  
Old 04-29-2015, 04:53 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

I would as well. I mean, they'll already have a choice of pet model/visuals which isn't on every server.

Code:
my %pethash = (
	1	=>	{
				name => "White Gorilla",
				race => 41,
				texture => 2,
				gender => 2,
				size => 5,
			},
	2	=>	{
				name => "Undead Gorilla",
				race => 41,
				texture => 1,
				gender => 2,
				size => 5,
			},
);
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:18 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