Likes: 0
Results 1 to 5 of 5
Thread: AuxProductions Releases.
-
11-03-10, 02:25 PM #1
AuxProductions Releases.
Register to remove this adAs now, this will be the official topic in which I'll be releasing the AuxProductions C++ scripts.
Currently, I have 3 scripts avaible for your use.
A Exchanger Npc.
Code:/*+++++++++++++++++++++++++++++++++++++ Copyright claimed by AuxProductions.+++ +++++++++++++++++++++++++++++++++++++*/ #include "StdAfx.h" #include "Setup.h" //ItemID of the item you want them to have. #define TOKEN10REWARD (ID) #define TOKEN20REWARD (ID) #define TOKEN30REWARD (ID) #define TOKEN40REWARD (ID) #define TOKEN50REWARD (ID) class SCRIPT_DECL KS_Exchange : 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 KS_Exchange::GossipHello(Object * pObject, Player* Plr, bool AutoSend) { GossipMenu *Menu; objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr); Menu->AddItem(9, "Pvp Tokens 10", 2); Menu->AddItem(9, "Pvp Tokens 20", 3); Menu->AddItem(9, "Pvp Tokens 30", 4); Menu->AddItem(9, "Pvp Tokens 40", 5); Menu->AddItem(9, "Pvp Tokens 50", 6); Menu->SendTo(Plr); } void KS_Exchange::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code) { GossipMenu *Menu; QueryResult *query; Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL; if(pCreature==NULL) return; switch(IntId) { case 0: GossipHello(pObject, Plr, true); break; case 1: { objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr); Menu->AddItem(9, "Pvp Tokens 10", 2); Menu->AddItem(9, "Pvp Tokens 20", 3); Menu->AddItem(9, "Pvp Tokens 30", 4); Menu->AddItem(9, "Pvp Tokens 40", 5); Menu->AddItem(9, "Pvp Tokens 50", 6); Menu->SendTo(Plr); break; } case 2:// 10 Killstreak rewards. { query = WorldDatabase.Query("SELECT `PvpToken` from `kill_streak_tokens` WHERE `name` = '%s'", Plr->GetName()); if (query->Fetch()[0].GetUInt32() >= 10) { Plr->GetItemInterface()->AddItemById(TOKEN10REWARD,1,0); WorldDatabase.Query("UPDATE `kill_streak_tokens` SET `Pvptoken`=(Pvptoken - 10) WHERE (`name`='%s')", Plr->GetName()); objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4, Plr); Menu->AddItem(9, "You've just exchanged 10 of your PvP tokens.", 1); Menu->AddItem(9, "Main Menu", 1); Menu->SendTo(Plr); } else { objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 5, Plr); Menu->AddItem(9, "You do not have enough Tokens for this exchange.", 1); Menu->AddItem(9, "Back", 1); Menu->SendTo(Plr); } } break; case 3:// 20 Killstreak rewards. { query = WorldDatabase.Query("SELECT `Pvptoken` from `Killsystem_Token` WHERE `name` = '%s'", Plr->GetName()); if (query->Fetch()[0].GetUInt32() >= 20) { Plr->GetItemInterface()->AddItemById(TOKEN20REWARD,1,0); WorldDatabase.Query("UPDATE `Killsystem_Token` SET `Pvptoken`=(Pvptoken - 20) WHERE (`name`='%s')", Plr->GetName()); objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 6, Plr); Menu->AddItem(9, "Congratulations, you exchanged 20 of your Tokens for Chaos Tokens.", 1); Menu->AddItem(9, "Main Menu", 1); Menu->SendTo(Plr); } else { objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 7, Plr); Menu->AddItem(9, "You do not have enough Tokens for this exchange.", 1); Menu->AddItem(9, "Back", 1); Menu->SendTo(Plr); } } break; case 4:// 30 Killstreak rewards. { query = WorldDatabase.Query("SELECT `Pvptoken` from `Killsystem_Token` WHERE `name` = '%s'", Plr->GetName()); if (query->Fetch()[0].GetUInt32() >= 30) { Plr->GetItemInterface()->AddItemById(TOKEN30REWARD,1,0); WorldDatabase.Query("UPDATE `Killsystem_Token` SET `Pvptoken`=(Pvptoken - 30) WHERE (`name`='%s')", Plr->GetName()); objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 8, Plr); Menu->AddItem(9, "Congratulations, you exchanged 30 of your Tokens for Chaos Tokens.", 1); Menu->AddItem(9, "Main Menu", 1); Menu->SendTo(Plr); } else { objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 9, Plr); Menu->AddItem(9, "You do not have enough Tokens for this exchange.", 1); Menu->AddItem(9, "Back", 1); Menu->SendTo(Plr); } } break; } } case 5:// 40 Killstreak rewards. { query = WorldDatabase.Query("SELECT `Pvptoken` from `Killsystem_Token` WHERE `name` = '%s'", Plr->GetName()); if (query->Fetch()[0].GetUInt32() >= 40) { Plr->GetItemInterface()->AddItemById(TOKEN40REWARD,1,0); WorldDatabase.Query("UPDATE `Killsystem_Token` SET `Pvptoken`=(Pvptoken - 40) WHERE (`name`='%s')", Plr->GetName()); objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 10, Plr); Menu->AddItem(9, "Congratulations, you exchanged 40 of your Tokens for Chaos Tokens.", 1); Menu->AddItem(9, "Main Menu", 1); Menu->SendTo(Plr); } else { objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 11, Plr); Menu->AddItem(9, "You do not have enough Tokens for this exchange.", 1); Menu->AddItem(9, "Back", 1); Menu->SendTo(Plr); } } break; case 6:// 50 Killstreak rewards. { query = WorldDatabase.Query("SELECT `Pvptoken` from `Killsystem_Token` WHERE `name` = '%s'", Plr->GetName()); if (query->Fetch()[0].GetUInt32() >= 50) { Plr->GetItemInterface()->AddItemById(TOKEN30REWARD,1,0); WorldDatabase.Query("UPDATE `Killsystem_Token` SET `Pvptoken`=(Pvptoken - 50) WHERE (`name`='%s')", Plr->GetName()); objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 12, Plr); Menu->AddItem(9, "Congratulations, you exchanged 50 of your Tokens for Chaos Tokens.", 1); Menu->AddItem(9, "Main Menu", 2); Menu->SendTo(Plr); } else { objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 13, Plr); Menu->AddItem(9, "You do not have enough Tokens for this exchange.", 1); Menu->AddItem(9, "Back", 1); Menu->SendTo(Plr); } } break; } void KS_Exchange::GossipEnd(Object * pObject, Player* Plr) { GossipScript::GossipEnd(pObject, Plr); } void SetupKS_Exchange(ScriptMgr * mgr) { GossipScript * gs = (GossipScript*) new KS_Exchange(); mgr->register_gossip_script(55555,gs); }
A Auto-Defend on Login.
Code:#include "StdAfx.h" #include "Setup.h" #ifdef WIN32 #pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float' #endif void OnEnterWorld(Player * pPlayer) { pPlayer->CastSpell(pPlayer, 642, true); Announce( "You're now guarded for 12seconds, run whislt you can!" ); } void SetupEnterWorld(ScriptMgr * mgr) { mgr->register_hook(SERVER_HOOK_EVENT_ON_ENTER_WORLD, OnEnterWorld);
A welcoming announcement.
Code:/* Small C++ script, credits to AuxProductions. */ #include "StdAfx.h" #include "Setup.h" #ifdef WIN32 #pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float' #endif void OnFirstEnterWorld(Player * pPlayer) { char message[500]; sprintf(message, "[SERVERNAME] Welcome our new player, %s to the server!", pPlayer->GetName()); sWorld.SendWorldWideScreenText(message); } void SetupOnFirstEnterWorld(ScriptMgr * mgr) { mgr->register_hook(SERVER_HOOK_EVENT_ON_FIRST_ENTER_WORLD, OnFirstEnterWorld); }
› See More: AuxProductions Releases.
-
11-03-10, 02:49 PM #2
Very nice! Simple, Yet Effective and Powerful!
Good Job mate, +Rep
-
11-03-10, 03:49 PM #3
-
11-03-10, 09:58 PM #4
-
12-03-10, 09:02 AM #5
Register to remove this adPretty sure I've seen the Divine Shield on login quite a few times before, only thing that looks different is it actually says that you've got 12 seconds, rest I've seen just cast it on the character and say nothing.
Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread
Visitors found this page by searching for:
Nobody landed on this page from a search engine, yet!
SEO Blog