Emulator Server Discussion World of Warcraft Emulator Server general chat . [NO Questions here]
How can i restrict the acces to my mall?
Knight-Lieutenant
Rep Power: 1
Reputation: 44 Posts: 238
Join Date: Dec 2007
How can i restrict the acces to my mall? -
03-01-2008
Ok guyes i maked my mall but i wanna restrict it to lvl 20 so only players lvl 20 can teleport trough my custom teleporter to it
Here is the source of my teleporter :
Code:
#include "StdAfx.h"
#include "Setup.h"
#ifdef WIN32
#pragma warning(disable:4305)// warning C4305: 'argument' : truncation from 'double' to 'float'
#endif
class SCRIPT_DECL Warper : 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;
}
};
void Warper::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(0, "Horde Cities", 1)
Menu->AddItem(1, "Alliance Cities", 2);}
Menu->AddItem(2, "The Shoping Center", 82);
Menu->AddItem(4, "Azeroth Instances", 30);
Menu->AddItem(5, "Outland Locations", 3);
Menu->AddItem(6, "Outland Instances", 50);
Menu->AddItem(7, "Shattrath", 20);
Menu->AddItem(8, "Gurubashi Arena PvP Ring", 21);
Menu->AddItem(11, "Remove Resurrection Sickness", 97);
if(AutoSend)
Menu->SendTo(Plr);
}
void Warper::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)
{
case 0: // Return to start
GossipHello(pObject, Plr, true);
break;
case 1: // Horde Cities
{
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->AddItem(0, "[Back]", 99);
Menu->SendTo(Plr);
}
break;
case 2: // Alliance Cities
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(5, "The Exodar", 8);
Menu->AddItem(5, "Stormwind", 9);
Menu->AddItem(5, "Ironforge", 10);
Menu->AddItem(5, "Darnassus", 11);
Menu->AddItem(0, "[Back]", 99);
Menu->SendTo(Plr);
}
break;
case 3: // Outland
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(5, "Hellfire Peninsula", 12);
Menu->AddItem(5, "Zangermarsh", 13);
Menu->AddItem(5, "Nagrand", 14);
Menu->AddItem(5, "Blades Edge Mountains", 15);
Menu->AddItem(5, "Netherstorm", 16);
Menu->AddItem(5, "Terokkar Forest", 17);
Menu->AddItem(5, "Shadowmoon Valley", 18);
Menu->AddItem(0, "[Back]", 99);
Menu->SendTo(Plr);
}
break;
case 4://Silvermoon
{
Plr->EventTeleport(530, 9400.486328, -7278.376953, 14.206780);
}break;
case 5://Orgrimmar
{
Plr->EventTeleport(1, 1371.068970, -4370.801758, 26.052483);
}break;
case 6://ThunderBluff
{
Plr->EventTeleport(1, -1304.569946, 205.285004, 68.681396);
}
break;
case 7://Undercity
{
Plr->EventTeleport(0, 2050.203125, 285.650604, 56.994549);
}
break;
case 8: //Exodar
{
Plr->EventTeleport(530, -4072.202393, -12014.337891, -1.277277);
}
break;
case 9: //Stormwind
{
Plr->EventTeleport(0, -9100.480469, 406.950745, 92.594185);
}
break;
case 10: //Ironforge
{
Plr->EventTeleport(0, -5028.265137, -825.976563, 495.301575);
}
break;
case 11: //Darnassus
{
Plr->EventTeleport(1, 9985.907227, 1971.155640, 1326.815674);
}
break;
////////////////
// Outland Menu
////////
case 12: //Hellfire Peninsula
{
Plr->EventTeleport(530, -248.160004, 922.348999, 84.379799);
}
break;
case 13: //Zangermarsh
{
Plr->EventTeleport(530, -225.863632, 5405.927246, 22.346397);
}
break;
case 14: //Nagrand
{
Plr->EventTeleport(530, -468.232330, 8418.666016, 28.031298);
}
break;
case 15: //Blades Edge Mountains
{
Plr->EventTeleport(530, 1471.672852, 6828.047852, 107.759239);
}
break;
case 16: //Netherstorm
{
Plr->EventTeleport(530, 3396.123779, 4182.208008, 137.097992);
}
break;
case 17: //Terokkar Forest
{
Plr->EventTeleport(530, -1202.426636, 5313.692871, 33.774723);
}
break;
case 18: //Shadowmoon Valley
{
Plr->EventTeleport(530, -2859.522461, 3182.34773, 10.008426);
}
break;
case 20: //Shattrath
{
Plr->EventTeleport(530, -1887.510010, 5359.379883, -12.427300);
}
break;
case 21: // Gurubsahi Arena
{
Plr->EventTeleport(0, -13232, 218, 32);
}
break;
case 30: // Azeroth Instances
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(5, "Shadowfang Keep", 31);
Menu->AddItem(5, "Scarlet Monastery", 32);
Menu->AddItem(5, "Zul'Farrak", 33);
Menu->AddItem(5, "Stratholme", 41);
Menu->AddItem(5, "Scholomance", 40);
Menu->AddItem(5, "Blackrock Spire", 42);
Menu->AddItem(5, "Onyxia's Lair", 38);
Menu->AddItem(5, "Molten Core", 37);
Menu->AddItem(5, "Zul'Gurub", 34);
Menu->AddItem(5, "Karazhan", 43);
Menu->AddItem(5, "Ahn'Qirai 20", 35);
Menu->AddItem(5, "Ahn'Qirai 40", 36);
Menu->AddItem(5, "Naxxramas", 39);
Menu->AddItem(5, "Caverns of Times", 44);
Menu->AddItem(0, "[Back]", 99);
Menu->SendTo(Plr);
}
break;
case 31: // Shadowfang Keep
{
Plr->EventTeleport(0, -234.495087, 1561.946411, 76.892143);
}
break;
case 32: // Scarlet Monastery
{
Plr->EventTeleport(0, 2870.442627, -819.985229, 160.331085);
}
break;
case 33: // Zul'Farrak
{
Plr->EventTeleport(1, -6797.278809, -2903.917969, 9.953360);
}
break;
case 34: // Zul'Gurub
{
Plr->EventTeleport(0, -11919.073242, -1202.459374, 92.298744);
}
break;
case 35: // Ahn'Qirai 20
{
Plr->EventTeleport(1, -8394.730469, 1485.658447, 21.038563);
}
break;
case 36: // Ahn'Qirai 40
{
Plr->EventTeleport(1, -8247.316406, 1970.156860, 129.071472);
}
break;
case 37: // Molten Core
{
// Plr->EventTeleport(0, -7515.409668, -1045.369629, 182.301208);
Plr->EventTeleport(409, 1089.6, -470.19, -106.41);
}
break;
case 38: // Onyxia
{
// Plr->EventTeleport(1, -4708.491699, -3727.672363, 54.535076);
Plr->EventTeleport(249, 30.0, -64.0, -5.0);
}
break;
case 39: // Naxxramas
{
// Plr->EventTeleport(0, 3132.915283, -3731.012939, 138.658371);
Plr->EventTeleport(533, 3006.06, -3436.72, 293.891);
}
break;
case 40: //Scholomance
{
Plr->EventTeleport(0, 1267.468628, -2556.651367, 94.127983);
}
break;
case 41: //Stratholme
{
Plr->EventTeleport(0, 3359.111572, -3380.8444238, 144.781860);
}break;
case 42: // Black ROck Spire
{
Plr->EventTeleport(0, -7527.129883, -1224.997437, 285.733002);
}break;
case 43: // Kharazan
{
// Plr->EventTeleport(0, -11122.913086, -2014.498779, 47.079350);
Plr->EventTeleport(532, -11087.3, -1977.47, 49.6135);
}break;
case 44: // Caverns of Times
{
Plr->EventTeleport(1, -8519.718750, -4297.542480, -208.441376);
}break;
case 50: // Outland Instances
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(0, "Outland Raids", 64);
Menu->AddItem(5, "Hellfire Ramparts", 51);
Menu->AddItem(5, "The Blood Furnace", 52);
Menu->AddItem(5, "The Shattered Halls", 53);
Menu->AddItem(5, "The Underbog", 54);
Menu->AddItem(5, "The Slave Pens", 55);
Menu->AddItem(5, "The Steamvault", 56);
Menu->AddItem(5, "Mana-Tombs", 57);
Menu->AddItem(5, "Auchenai Crypts", 58);
Menu->AddItem(5, "Sethekk Halls", 59);
Menu->AddItem(5, "Shadow Labyrinth", 60);
Menu->AddItem(5, "The Mechanar", 61);
Menu->AddItem(5, "The Botanica", 62);
Menu->AddItem(5, "The Arcatraz", 63);
Menu->AddItem(0, "[Back]", 99);
Menu->SendTo(Plr);
}
break;
case 51: // Hellfire Ramparts
{
Plr->EventTeleport(530, -360.670990, 3071.899902, -15.097700);
}break;
case 52: // The Blood Furnace
{
Plr->EventTeleport(530, -303.506012, 3164.820068, 31.742500);
}break;
case 53: // The Shattered Halls
{
Plr->EventTeleport(530, -311.083527, 3083.291748, -3.745923);
}break;
case 54: // The Underbog
{
Plr->EventTeleport(530, 777.088989, 6763.450195, -72.062561);
}break;
case 55: // The Slave Pens
{
Plr->EventTeleport(530, 719.507996, 6999.339844, -73.074303);
}break;
case 56: // The Steamvault
{
Plr->EventTeleport(530, 816.590027, 6934.669922, -80.544601);
}break;
case 57: // Mana-Tombs
{
Plr->EventTeleport(530, -3079.810059, 4943.040039, -101.046997);
}break;
case 58: // Auchenai Crypts
{
Plr->EventTeleport(530, -3361.959961, 5225.770020, -101.047997);
}break;
case 59: // Sethekk Halls
{
Plr->EventTeleport(530, -3362.219971, 4660.410156, -101.049004 );
}break;
case 60: // Shadow Labyrinth
{
Plr->EventTeleport(530, -3645.060059, 4943.620117, -101.047997);
}break;
case 61: // The Mechanar
{
Plr->EventTeleport(530, 2862.409912, 1546.089966, 252.158691);
}break;
case 62: // The Botanica
{
Plr->EventTeleport(530, 3413.649902, 1483.319946, 182.837997);
}break;
case 63: // The Arcatraz
{
Plr->EventTeleport(530, 3311.598145, 1332.745117, 505.557251);
}break;
case 64: // Outland Raids
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(5, "Magtheridon's Lair", 65);
Menu->AddItem(5, "Serpentshrine Cavern", 66);
Menu->AddItem(5, "Gruul's Lair", 67);
Menu->AddItem(5, "The Eye", 68);
Menu->AddItem(5, "Black Temple", 69);
Menu->AddItem(0, "[Back]", 99);
Menu->SendTo(Plr);
}
break;
case 65: // Magtheridon's Lair
{
Plr->EventTeleport(530, -313.678986, 3088.350098, -116.501999);
}break;
case 66: // Serpentshrine Cavern
{
Plr->EventTeleport(530, 830.542908, 6865.445801, -63.785503);
}break;
case 67: // Gruul's Lair
{
Plr->EventTeleport(530, 3549.424072, 5179.854004, -4.430779);
}break;
case 68: // The Eye
{
Plr->EventTeleport(530, 3087.310059, 1373.790039, 184.643005);
}break;
case 69: // Black Temple
{
// Plr->EventTeleport(530, -3609.739990, 328.252014, 37.307701 );
Plr->EventTeleport(564, 97.0894, 1001.96, -86.8798 );
}break;
case 82: // The Mall
{
Plr->EventTeleport(37, 63.214725, 23.134642, 238.261841);
}break;
case 95: // Bind Position
{
Plr->GetSession()->SendInnkeeperBind(pCreature);
}break;
case 97: // Remove res sickness
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Plr->addSpell(15007); // learn res sickness
Plr->removeSpell(15007,0,0,0); // un learn res sickness
pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "I have removed your Resurrection Sickness.By $HaDoW" );
Menu->AddItem(0, "[Back]", 99);
Menu->SendTo(Plr);
}
break;
case 99: //main menu
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(0, "Horde Cities", 1);
Menu->AddItem(1, "Alliance Cities", 2);
Menu->AddItem(2, "The Shoping Center", 82);
Menu->AddItem(4, "Azeroth Instances", 30);
Menu->AddItem(5, "Outland Locations", 3);
Menu->AddItem(6, "Outland Instances", 50);
Menu->AddItem(7, "Shattrath", 20);
Menu->AddItem(8, "Gurubashi Arena PvP Ring", 21);
Menu->AddItem(11, "Remove Resurrection Sickness", 97);
Menu->SendTo(Plr);
}
break;
}
}
void Warper::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}
void SetupWarper(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new Warper();
/* Teleporter List */
mgr->register_gossip_script(123456, gs); // Nega
}
( Source taken from ascentemu and from Gastric for the Main Cities )
So anyone can help me ?
Use the "Search" Button, its not hard Everyone who helps and contributes
Donate to remove ads. Contributor
Rep Power: 4
Reputation: 184 Posts: 1,179
Join Date: Sep 2006
03-01-2008
Well, I am not that good with programming, but the custom source should be placed before, or in this part of the code
Code:
class SCRIPT_DECL Warper : 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;
}
};
void Warper::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
But, I can't actually manage to read it, if it was done in LUA I could've done it without problems, but C++...
Sorry,
< ToXiCa> warsheep + denmark + VIP lounge + cheese = love <3 FOR A MOMENT, NOTHING HAPPENED. THEN, AFTER A SECOND OR SO, NOTHING CONTINUED TO HAPPEN.
Knight-Lieutenant
Rep Power: 1
Reputation: 44 Posts: 238
Join Date: Dec 2007
03-01-2008
No problem mate thanks for trying to help me.
So? anyone else?
Use the "Search" Button, its not hard Everyone who helps and contributes
Master Sergeant
Rep Power: 2
Reputation: 22 Posts: 113
Join Date: Oct 2007
03-01-2008
Here is what I would do wrap the Shopping mall menu item in an if statement
Quote:
if (Plr->getlevel() >= 20)
Menu->AddItem(2, "The Shoping Center", 82);
What this will do is only show the Shoppin Center option if the player is level 20 or over.
Banned
Rep Power: 0
Reputation: 101 Posts: 141
Join Date: May 2007
Location: Localhost
03-01-2008
Code:
if(Plr->getLevel() >= 20)
{
Menu->AddItem(2, "The Shoping Center", 82);
That should do it!
Contributor
Rep Power: 4
Reputation: 184 Posts: 1,179
Join Date: Sep 2006
03-01-2008
I guess I would just place a critter or something that would attack people once they arrived, and it would check if the player was level 20 or higher, it would kill itself, or if the player was below 20, port him somewhere
< ToXiCa> warsheep + denmark + VIP lounge + cheese = love <3 FOR A MOMENT, NOTHING HAPPENED. THEN, AFTER A SECOND OR SO, NOTHING CONTINUED TO HAPPEN.
Master Sergeant
Rep Power: 2
Reputation: 22 Posts: 113
Join Date: Oct 2007
03-01-2008
One other thing I noticed about your script
Quote:
Menu->AddItem(0, "Horde Cities", 1)
Menu->AddItem(1, "Alliance Cities", 2);}
Menu->AddItem(2, "The Shoping Center", 82);
Menu->AddItem(4, "Azeroth Instances", 30);
Menu->AddItem(5, "Outland Locations", 3);
Menu->AddItem(6, "Outland Instances", 50);
Menu->AddItem(7, "Shattrath", 20);
Menu->AddItem(8, "Gurubashi Arena PvP Ring", 21);
Menu->AddItem(11, "Remove Resurrection Sickness", 97);
The first parameter you are passing in is the type of icon that shows up on the menu option. The values are like this as what i've found out myself anyways. If there are others I know I would love to know myself.
// 0 - Gossip Bubble, 1 - Vendor bag, 2 - Wings, 3 - Training book, 4/5 - Wheel // 6 - Item/Coin 7- - Dialog bubble , 8 - Stack of Coins, 9 - Swords I would do mine like this to give it a little personal touch. =) Hope this helps. Quote:
Menu->AddItem(4, "Horde Cities", 1) Menu->AddItem(4, "Alliance Cities", 2);} Menu->AddItem(2, "The Shoping Center", 82); Menu->AddItem(4, "Azeroth Instances", 30); Menu->AddItem(4, "Outland Locations", 3); Menu->AddItem(4, "Outland Instances", 50); Menu->AddItem(2, "Shattrath", 20); Menu->AddItem(2, "Gurubashi Arena PvP Ring", 21); Menu->AddItem(7, "Remove Resurrection Sickness", 97);
Knight-Lieutenant
Rep Power: 1
Reputation: 44 Posts: 238
Join Date: Dec 2007
03-01-2008
Error :
Code:
1>..srcWarpNPCCustom_Teleporters.cpp(26) : error C2039: 'getlevel' : is not a member of 'Player'
1> d:diferiteascentbranches3_8_stablesrcascent-worldPlayer.h(794) : see declaration of 'Player'
Use the "Search" Button, its not hard Everyone who helps and contributes
Master Sergeant
Rep Power: 2
Reputation: 22 Posts: 113
Join Date: Oct 2007
03-01-2008
I think it was an error on my part, was putting in by memory. I believe this should work as my original code had getlevel()
if (Plr->getLevel() >= 20)
But getLevel() is definitely part of Player.
Last edited by vb4evr; 03-01-2008 at 12:56 PM ..
Master Sergeant
Rep Power: 2
Reputation: 22 Posts: 113
Join Date: Oct 2007
03-01-2008
Knife did this work for you?
Knight-Lieutenant
Rep Power: 1
Reputation: 44 Posts: 238
Join Date: Dec 2007
03-01-2008
Im trying now i wasnt home srry
Use the "Search" Button, its not hard Everyone who helps and contributes
Knight-Lieutenant
Rep Power: 1
Reputation: 44 Posts: 238
Join Date: Dec 2007
03-01-2008
Compiled worked perfectly but it doenst restrict that......
Maybe it needs some command like if and else dunno
Edit : Probleme Solved
Here it is how it should look like :
Code:
case 82: // The Shopping Center
if(Plr->getLevel() < 20)
{
pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You do not qualify for entry to our custom Mall." );
Plr->Gossip_Complete();
}else{
objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 1, Plr);
Plr->EventTeleport(37, 63.214725, 23.134642, 238.261841);
}break;
Thanks anyone for trying to help me
Use the "Search" Button, its not hard Everyone who helps and contributes
Last edited by Knife; 03-01-2008 at 04:33 PM ..
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by
vBSEO 3.2.0
vBulletin Skin developed by:
vBStyles.com