MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides

Homepage Register FAQ Members Mark Forums Read Advertise Marketplace FPSowned


Go Back   MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides > WoW Emulator Server > Emulator Server Guides > Ascent Guides
Reload this Page How to make warp npc
Ascent Guides This section is for WoW emulated server, Ascent guides.
[NO QUESTIONS HERE]

Reply
 
LinkBack Thread Tools
How to make warp npc
(#1)
Old
munchy's Avatar
munchy is Offline
Master Sergeant
Rep Power: 1
Reputation: 13
munchy is on a distinguished road
 
Posts: 88
Join Date: Jun 2008
Location: In My Own World
How to make warp npc - 07-21-2008

Here is a guide for ppl i quess lol for npc



type this into your notepad or visual c++ or what ever your gonna use


Code:
#include "StdAfx.h"
#include "Setup.h"

#ifdef WIN32
#pragma warning(disable:4305)
#endif

that is your opening text

Next type this under that



Code:

class SCRIPT_DECL GlobalNPC : public GossipScript
{
public:
void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
void GossipEnd(Object * pObject, Player* Plr);
void Destroy()
{
delete this;
}
};

ok now we will make the opening menu that you see when you speak to the warpNPC



Code:

void GlobalNPC::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
now here is where we divide the horde and ally warps

"i got bored of old color so i went to red"

Code:

if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)ok that divided them so now under that put


Code:

{Menu->AddItem(0, "Horde Cities", 1);}else{Menu->AddItem(1, "Alliance Cities", 2);}
that will make it where if alliance they cant port to horde and if horde they cant port to alliance



Code:

Menu->AddItem(2, "Global Locations", 80);

look at taht study it clearly stare stare stare BAM!!! you got hit with knowledge

lets break it down

Menu- its stating that its part of the menu obvious right

->pointing to the command i guess lol thats my easy description

AddItem - This is what will add this to be selectable on the menu as a port or another menu with more ports

the 2 is just a number for the icon that will be next to it i usually put 0 for it cuase im cool like that

"Global Locations" - that is the name of the menu or port

then 80 - that is the case that that menu links to

ok lets create our own little custom one here just so we understand it

now do what ever you want for yours dont scroll down past the line below til you finish your menu peice



_

ok for my creation i got


Menu->AddItem(4, "ZOMG this guide is awesome", 20);

weird eh,

but if your menu is kind like mine then Good job

now before we go any further let me mention the case thing i said earlier

on my example i put the case as 20

so somewhere in my script will be


Code:

case 20: //Magers guide
now if you have a slight C++ knowledge you know what that means
but if you dont well then your screwed lol j/k
the case is what the link will send you to
if the case is a teleport it will port you to where its supposed to
if its a menu you get to go to another menu again

do you kinda understand??

anyway after you made all the menu items you want for the first thing

(btw dont make the Case the same as others or else it will do the same thing)

after your done with your main menu type

Code:

if(AutoSend)
Menu->SendTo(Plr);
}

void GlobalNPC::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
if(pCreature==NULL)
return;

GossipMenu * Menu;
switch(IntId)
{
it should somewhat look like this


Code:
if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
{Menu->AddItem(0, "Horde Cities", 1);}else{Menu->AddItem(1, "Alliance Cities", 2);}
Menu->AddItem(3, "Azeroth Instances", 30);
Menu->AddItem(4, "Outland Instances", 50);
Menu->AddItem(5, "Shattrath", 20);
Menu->AddItem(6, "Gurubashi Arena", 21);
Menu->AddItem(8, "Buff me up, baby!", 96);
Menu->AddItem(7, "Make This Place Your Home", 95);
Menu->AddItem(9, "Remove Resurrection Sickness", 97);

if(AutoSend)
Menu->SendTo(Plr);
}

void GlobalNPC::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
if(pCreature==NULL)
return;

GossipMenu * Menu;
switch(IntId)
{great now we got that set up
time for Case 0:

Code:
case 0:
GossipHello(pObject, Plr, true);
break;that goes directly under the little "{" mark from the code above

now we go to case 1

now one of your menu items that you made should have started with case 1 if not change it or just do a different case its all the same thing

now if you want the case to send you to another menu just make it look like this a bit

Code:
case 1:
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(5, "Silvermoon", 4);
Menu->AddItem(5, "Orgrimmar", 5);
Menu->AddItem(5, "Thunder Bluff", 6);
Menu->AddItem(5, "Undercity", 7);

Menu->SendTo(Plr);
}
break;that goes directly under the little "{" mark from the code above

I taught the Menu items so i dont need to describe that again
and the Menu->SendTo(Plr);
just make it to where it shows up

all you need to know now is to make it port

that would be a simple command

so lets base off of Menu->AddItem(5, "Thunder Bluff", 6);

so now we will put


Code:
case 6://ThunderBluff
{
Plr->EventTeleport(1, -1304.569946, 205.285004, 68.681396);
}
break;the //thunderbluff is just a comment that reminds you that, that one is the one that ports you to Thunder bluff

Plr->EventTeleport - that is innitiating that the Plr or Player is going have the event teleport used on him/her

then the coords are where you end up at


now just type this at the bottom of this and your done



Code:
void GlobalNPC::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}

void SetupGlobalNPC(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new GlobalNPC();
mgr->register_gossip_script(NPC ID)
}replace the NPC ID with your NPCs ID and compile

if you need help compiling look to another guide please

Well Guys i hoped you liked it and please leave feed back

i wanna know what you guys think


2 Words guys dont like enless you put them together "dont" and "stop".
Reply With Quote

Donate to remove ads.
(#2)
Old
munchy's Avatar
munchy is Offline
Master Sergeant
Rep Power: 1
Reputation: 13
munchy is on a distinguished road
 
Posts: 88
Join Date: Jun 2008
Location: In My Own World
07-21-2008

If u need any help at all ask me. [dont take my +rep thingy as if i want +rep want to try something lol. + Rep


2 Words guys dont like enless you put them together "dont" and "stop".
Reply With Quote
(#3)
Old
munchy's Avatar
munchy is Offline
Master Sergeant
Rep Power: 1
Reputation: 13
munchy is on a distinguished road
 
Posts: 88
Join Date: Jun 2008
Location: In My Own World
07-21-2008

lol ok i know hot to do +rep sigh now


2 Words guys dont like enless you put them together "dont" and "stop".
Reply With Quote
(#4)
Old
Apple's_Ascent's Avatar
Apple's_Ascent is Offline
Knight-Lieutenant
Rep Power: 2
Reputation: 58
Apple's_Ascent will become famous soon enough
 
Posts: 341
Join Date: Apr 2007
Location: In the Database
07-21-2008

Nice +2 rep


loginapple.game-host.org
Reply With Quote
(#5)
Old
Jackie Moon's Avatar
Jackie Moon is Offline
Knight
Rep Power: 1
Reputation: 36
Jackie Moon is on a distinguished road
 
Posts: 217
Join Date: May 2008
Location: Shabangabang
07-21-2008

Cool... bit of a confusing guide def not for beginners


Reply With Quote
(#6)
Old
**Sweeny**'s Avatar
**Sweeny** is Offline
Knight-Lieutenant
Rep Power: 1
Reputation: 33
**Sweeny** is on a distinguished road
 
Posts: 284
Join Date: Dec 2007
07-22-2008

Wow.. this is just magers guide...
Quote:
case 20: //Magers guide
now if you have a slight C++ knowledge you know what that means
but if you dont well then your screwed lol j/k
the case is what the link will send you to
if the case is a teleport it will port you to where its supposed to
if its a menu you get to go to another menu again
Copy and paste O.o
You could have alteast put the source code in [c ode] [/code] that's just confusing for people..
Quote:
case 6://ThunderBluff
{
Plr->EventTeleport(1, -1304.569946, 205.285004, 68.681396);
}
break;the //thunderbluff is just a comment that reminds you that, that one is the one that ports you to Thunder bluff



Last edited by **Sweeny**; 07-22-2008 at 02:19 AM.
Reply With Quote
(#7)
Old
bloodyhell321 is Offline
Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep)
Rep Power: 0
Reputation: 1
bloodyhell321 is an unknown quantity at this point
 
Posts: 2
Join Date: Sep 2008
4 Weeks Ago

Question, What is the NPC ID? Is it the actual id to spawn a npc like .npc spawn NPC_ID? Or is it the SQL entry? Willing to give a +rep to anyone who tells me
Reply With Quote
(#8)
Old
*Scripted* is Offline
Banned
Rep Power: 0
Reputation: 41
*Scripted* is on a distinguished road
 
Posts: 246
Join Date: Aug 2008
4 Weeks Ago

Its ok he wants member rank :P no rlly u failz don't Copy and paste...
Reply With Quote
Reply

Donate to remove ads.

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are On



Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344