<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides - Emulator Server Guides</title>
		<link>http://www.mmowned.com/forums/</link>
		<description><![CDATA[Guides for working with World of Warcraft Emulator servers. Learn how to create a WoW Server here.
[NO QUESTIONS HERE]]]></description>
		<language>en</language>
		<lastBuildDate>Fri, 20 Nov 2009 23:40:36 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>5</ttl>
		<image>
			<url>http://mmowned.com/forums/images/mmowned/misc/rss.jpg</url>
			<title>MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides - Emulator Server Guides</title>
			<link>http://www.mmowned.com/forums/</link>
		</image>
		<item>
			<title>How to: Make a gossip NPC ;o</title>
			<link>http://www.mmowned.com/forums/emulator-server-guides/269115-how-make-gossip-npc-o.html</link>
			<pubDate>Fri, 20 Nov 2009 03:20:16 GMT</pubDate>
			<description><![CDATA[Well! You wana learn how to make your own teleporter for your awesome wow server? Welll &#8230;.. you've come to the right place ;) It's actually &#8230;.. with...]]></description>
			<content:encoded><![CDATA[<div>Well! You wana learn how to make your own teleporter for your awesome wow server? Welll &#8230;.. you've come to the right place ;) It's actually &#8230;.. with some attention involved (yes&#8230;. you need to pay attention, I can't just drill it into your mind..that would be quite awesome though ^^) NOT THAT HARD! Lets start off shalllll we?<br />
<br />
Remember &#8230; Lua is a case sensitive language!<br />
<br />
LETS START!<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">--[[<br />
You can put anything you want here! It will NOT affect the script, it may go on for as long as you, just make sure to close it at the end !<br />
--]]<br />
<br />
local Teleporter_ID = INSERT,YOUR.TELEPORTER.ID.HERE! ;)<br />
<br />
function TeleporterOnTalk(Unit, Event, Player)<br />
Unit:GossipCreateMenu(100, player, 0)</code><hr />
</div>Woah! Hold up! WHAT THE HELL DID YOU DO THERE!!!!<br />
<br />
Alrighty, Lets break that down shall we?<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">function TeleporterOnTalk(Unit, Event, Player)</code><hr />
</div>function &#8230; basically helps the script &#8230; well &#8230; function!, You cannot have a functioning script without it!<br />
<br />
Now then &#8230;.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">Unit:GossipCreateMenu(100, player, 0)</code><hr />
</div>This is going to make your menu visible, so you can &#8230; add items ;)<br />
<br />
shall we continue?<br />
<br />
We so far have this:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">--[[<br />
You can put anything you want here! It will NOT affect the script, it may go on for as long as you, just make sure to close it at the end !<br />
--]]<br />
<br />
local Teleporter_ID = INSERT,YOUR.TELEPORTER.ID.HERE! ;)<br />
<br />
function TeleporterOnTalk(Unit, Event, Player)<br />
Unit:GossipCreateMenu(100, player, 0)</code><hr />
</div>Lets add a little more shall we? It's kinda of &#8230;.. well .. PLAIN!<br />
<br />
<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">--[[<br />
You can put anything you want here! It will NOT affect the script, it may go on for as long as you, just make sure to close it at the end !<br />
--]]<br />
<br />
local Teleporter_ID = INSERT,YOUR.TELEPORTER.ID.HERE! ;)<br />
<br />
function TeleporterOnTalk(Unit, Event, Player)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipCreateMenu(100, player, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Take meh to your epic mall.&quot;, 1, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Eww get this re zsickness off me!&quot;, 2, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Nevermind, I don't wana talk to you!&quot;, 3)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipSendMenu(player)<br />
end</code><hr />
</div>WHAT THE F*** DID YOU DO THERE!<br />
<br />
Calm down! If your looking at that thinking what the hell are all those .. numbers and stuff &#8230; DO NOT WORRY, I will explain it all in good time ;)<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">Unit:GossipMenuAddItem(0, &quot;Take meh to your epic mall.&quot;, 1, 0)</code><hr />
</div>This will be adding the item Take meh to your epic mall to your teleporter, so now when the player comes up to your npc, right clicks him he will show this to the player! of course it won't do anything because thats nothing but a bunch of words &#8230;. for now.<br />
notice the 0 infront of the text, that is the logo that will appear in front of your message<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">0 = Chat bubble<br />
&nbsp; &nbsp; &nbsp; &nbsp; 1 = Bag<br />
&nbsp; &nbsp; &nbsp; &nbsp; 2 = Wings<br />
&nbsp; &nbsp; &nbsp; &nbsp; 3 = Book<br />
&nbsp; &nbsp; &nbsp; &nbsp; 4 = Cog/Gear<br />
&nbsp; &nbsp; &nbsp; &nbsp; 5 = Cog/Gear<br />
&nbsp; &nbsp; &nbsp; &nbsp; 6 = Bag with coin<br />
&nbsp; &nbsp; &nbsp; &nbsp; 7 = Chat bubble with &quot;...&quot;</code><hr />
</div>- note, credits for neglected cause I took those off him ;)<br />
<br />
the 1 infront of the text is the INTID, this is very important, every single item you have on your teleporter MUST have a different init. The INTID is what will help your message do something. For example, Take meh to your epic mall is just text, with the intid you can make it so it actually teleports you! FASCINATING, RIGHT?<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">Unit:GossipSendMenu(player)</code><hr />
</div>This is basically sending the menu to the player so he gets it, easy stuff.<br />
<br />
the 0 after the INTID, disregard that, but make sure you always keep it at 0, I personally have no clue what it does ;p.<br />
<br />
Now then! Your teleporter looks like this right now<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">--[[<br />
You can put anything you want here! It will NOT affect the script, it may go on for as long as you, just make sure to close it at the end !<br />
--]]<br />
<br />
local Teleporter_ID = INSERT,YOUR.TELEPORTER.ID.HERE! ;)<br />
<br />
function TeleporterOnTalk(Unit, Event, Player)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipCreateMenu(100, player, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Take meh to your epic mall.&quot;, 1, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Eww get this rez sickness off me!&quot;, 2, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Nevermind, I don't wana talk to you!&quot;, 3, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipSendMenu(player)<br />
end</code><hr />
</div>Lets make it so those &quot;items&quot; do the things they are required too, we need to start off by making another function<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">function TeleporterOnSelect(Unit, Event, player, id, intid, code, pmisc)<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (intid ==1) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:Teleport(MAPID, x, y, z)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
end</code><hr />
</div>HOLD UP, WHAT &#8230; IM &#8230;.. AHHHHHHH<br />
<br />
Breathe, You'll understand it, just let me explain!<br />
<br />
What this basically is doing is saying If the Intid is 1, which, if you recall above, is the Take meh to the epic mall, You teleport the player to the specified coordinates. It's very easy to understand. Once the player gets teleported, the gossip is completed and the player is sent to his specified destination ;). In order to get map id, go to the place you want your players to teleport to ingame, and type .gps, this should give you all the things you need to fill in the teleport part. Wait a second .. WHY THE 2 ENDS? well, the if statement requires its own end while the whole chunk itself requires an end, thus, resulting in two ends (you do the math ;))<br />
<br />
Your script now looks like this<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">--[[<br />
You can put anything you want here! It will NOT affect the script, it may go on for as long as you, just make sure to close it at the end !<br />
--]]<br />
<br />
local Teleporter_ID = INSERT,YOUR.TELEPORTER.ID.HERE! ;)<br />
<br />
function TeleporterOnTalk(Unit, Event, Player)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipCreateMenu(100, player, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Take meh to your epic mall.&quot;, 1, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Eww get this rez sickness off me!&quot;, 2, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Nevermind, I don't wana talk to you!&quot;, 3, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipSendMenu(player)<br />
end<br />
<br />
function TeleporterOnSelect(Unit, Event, player, id, intid, code, pmisc)<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (intid ==1) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:Teleport(MAPID, x, y, z)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
end</code><hr />
</div>Lets add so it takes the rez sickness off you ;)<br />
<br />
	<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">if (intid == 2) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (player:HasAura(15007) == true) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:SendBroadcastMessage(&quot;AMG I REMOVED YUR REZ SICKNESS!&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:RemoveAura(15007)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:SendBroadcastMessage(&quot;LIAR U DONT HAZ TEH REZ SICKNESS&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
end</code><hr />
</div>DONT CLOSE THE WEBPAGE JUST YET CUZ YOU DON'T UNDERSTAND! Gief me some time to explain ;)<br />
<br />
so, your telling the server if the intid is 2, and the player has the aura 15007 (resurrection sickness) on him, it will remove the sickness and give him the message It's been removed. Easy stuff, Don't panic.<br />
<br />
Now .. the ELSE, that's there if the player decides to be funny and click it even though he does NOT have resurrection sickness. IT will simply say, you do not have resurrection sickness and not do anything. EASY EASY EASY<br />
<br />
THREE ENDS? Well &#8230; You have an if, you have an else, and you have the chunk of the script you wana end, you do the math &#8230;. If + else + the chunk of the script = 3 ENDS!!! Good Job!!!!<br />
<br />
Now the last part &#8230;. saying the I don't wana talk to you part, Is real easy stuff.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">if (intid == 3) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
end</code><hr />
</div>Mkayy, How you gunna tell the script what NPC to put this on to? <br />
<br />
RegisterUnitEvents :)<br />
<br />
The Whole Script:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">local Teleporter_ID = INSERT,YOUR.TELEPORTER.ID.HERE! ;)<br />
<br />
function TeleporterOnTalk(Unit, Event, Player)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipCreateMenu(100, player, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Take meh to your epic mall.&quot;, 1, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Eww get this rez sickness off me!&quot;, 2, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Nevermind, I don't wana talk to you!&quot;, 3, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipSendMenu(player)<br />
end<br />
<br />
function TeleporterOnSelect(Unit, Event, player, id, intid, code, pmisc)<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (intid ==1) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:Teleport(MAPID, x, y, z)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
end<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (intid == 2) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (player:HasAura(15007) == true) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:SendBroadcastMessage(&quot;AMG I REMOVED YUR REZ SICKNESS!&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:RemoveAura(15007)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:SendBroadcastMessage(&quot;LIAR U DONT HAZ TEH REZ SICKNESS&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
end<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (intid == 3) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
end<br />
<br />
RegisterUnitGossipEvent(Teleporter_ID, 1, &quot;TeleporterOnTalk)<br />
RegisterUnitGossipEvent(Teleporter_ID, 2, &quot;TeleporterOnSelect)</code><hr />
</div><br />
<br />
AMG YOU MADE UR FIRST GOSSIP NPC HOOOOOOORAYYYYYYYYY!!!!!!!<br />
<br />
and &#8230; In the end .. credits go to neglected for teaching me how to script in the first place ;) I'm passing the knowledge on to you!<br />
<br />
Note: You may want to organize your scripts, Here is the same script, but organized to make it easier.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">-- Local<br />
local Teleporter_ID = INSERT,YOUR.TELEPORTER.ID.HERE! ;)<br />
-- Functions<br />
function TeleporterOnTalk(Unit, Event, Player)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipCreateMenu(100, player, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Take meh to your epic mall.&quot;, 1, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Eww get this rez sickness off me!&quot;, 2, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipMenuAddItem(0, &quot;Nevermind, I don't wana talk to you!&quot;, 3, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipSendMenu(player)<br />
end<br />
<br />
function TeleporterOnSelect(Unit, Event, player, id, intid, code, pMisc)<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (intid ==1) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:Teleport(MAPID, x, y, z)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
end<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (intid == 2) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (player:HasAura(15007) == true) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:SendBroadcastMessage(&quot;AMG I REMOVED YUR REZ SICKNESS!&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:RemoveAura(15007)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player:SendBroadcastMessage(&quot;LIAR U DONT HAZ TEH REZ SICKNESS&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
end<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (intid == 3) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unit:GossipComplete()<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
end<br />
--Registers<br />
RegisterUnitGossipEvent(Teleporter_ID, 1, &quot;TeleporterOnTalk)<br />
RegisterUnitGossipEvent(Teleporter_ID, 2, &quot;TeleporterOnSelect)</code><hr />
</div>Makes no difference, Anyways, You have fun ;)<br />
<br />
I'm still quite a beginner at lua, I made this guide quite quickly, so if you do find an error, please tell me and I'll be hasty to correct it.<br />
<br />
 -- BEST REGARDS, Navraj/Warriar Ac-web/MMowned.</div>

]]></content:encoded>
			<category domain="http://www.mmowned.com/forums/emulator-server-guides/">Emulator Server Guides</category>
			<dc:creator>Warriar</dc:creator>
			<guid isPermaLink="true">http://www.mmowned.com/forums/emulator-server-guides/269115-how-make-gossip-npc-o.html</guid>
		</item>
	</channel>
</rss>
