Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: MiscNPC

  1. #1
    Grunt

    Join Date
    Aug 2008
    Posts
    41
    Post Thanks / Like
    Rep Power
    17
    Reputation
    41

    MiscNPC


    Register to remove this ad
    Made by myself, can Heal player, reset talents, unlock fp's, save to DB, remove res sick, tele, buff's, advance all skills to 350 and explore all maps.

    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #define MISCNPC 129876
    
    class SCRIPT_DECL MiscNPC : 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 MiscNPC::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
        {
            if(Plr->CombatStatus.IsInCombat())
        {
            Plr->BroadcastMessage("Come back when you are not longer in combat!");
            return;
        }
            GossipMenu *Menu;
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    
            Menu->AddItem(0, "Low health! Heal me!", 1);  
            Menu->AddItem(0, "Reset Talents", 2);
            Menu->AddItem(0, "Save to DB", 3);
            Menu->AddItem(0, "Unlock all flight paths", 4);
            Menu->AddItem(0, "Remove Res sickness", 5);
            Menu->AddItem(0, "Main cities.", 6);
            Menu->AddItem(0, "Advance All skills (1-350)", 7);
            Menu->AddItem(0, "Explore all maps", 8);
            Menu->AddItem(0, "Buff me up!", 9);
    
    
            if(AutoSend)
                Menu->SendTo(Plr);
        }
    
    void MiscNPC::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
        {
        Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
        if(pObject==NULL)
            return;
    
            GossipMenu * Menu;
            switch(IntId)
            {
            case 1: //heal     
            
            uint32 price=1000; //10 Silver
            uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
            if (currentgold>=price){
            int32 newgold = currentgold - price; 
            Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold);
            pCreature->CastSpell(Plr, 25840, 0); //Full heal
            pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Pleasure doing buisness." );
        }else{
    Plr->BroadcastMessage("You don't have enough money to be healed!");
    }
    }break;
            
            case 2: //Reset Talent
        {
            uint32 price = 1000; //10 silver
            uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
            if (currentgold>=price){
            int32 newgold = currentgold - price;
            Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold);
            Plr->BroadcastMessage("Choice your next points carefully, journeymen");
            Plr->Reset_Talents();
            } else {
            Plr->BroadcastMessage("You don't have enough money to afford a talent reset!");
            }
            }break;
    
            case 3: //Save to DB
                plr->SaveToDB(true);
                Plr->BroadcastMessage("Saved to database");\
                }break;
    
            case 4: //Unlock all flight paths.
                {
            uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
            if(currentgold>50000){
            int32 newgold = currentgold - 50000;
            Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold);
            for (uint8 i=0; i<8; i++)
            {
            Plr->SetTaximask(i, 0xFFFFFFFF);
            }
            Plr->BroadcastMessage("No more looking for flight paths my friend.");
            Plr->Gossip_Complete();
            }else{
            Plr->BroadcastMessage("You have unlocked all flight paths %s");
            Plr->Gossip_Complete();
            }
            }break;
    
    
        case 5:// Remove Res Sickness
            {
            uint32 price = 5000; //50 silver
            uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
            if (currentgold>=price){
            int32 newgold = currentgold - price;
            Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold);
            Plr->BroadcastMessage("You have been cleansed");
            Plr->addSpell(15007);
            Plr->removeSpell(15007, 0, 0, 0);
            }
            }break;
    
        case 6: // Main Cities
            {
            if(Plr->GetTeam() == 0)
        {
            Menu->AddItem(0, "Stormwind", 20);
            Menu->AddItem(0, "Ironforge", 21);
            Menu->AddItem(0, "Exodar", 22);
            Menu->AddItem(0, "Darnassus", 23);
            Menu->SendTo(Plr);
            }
        else
        {
            if (plr->GetTeam() == 1)
            {
            Menu->AddItem(0, "Orgrimar", 30);
            Menu->AddItem(0, "Thunder Bluff", 31);
            Menu->AddItem(0, "Silvermoon City", 32);
            Menu->AddItem(0, "Undercity", 33);
            Menu->SendTo(Plr);
            }break;
    
    
    
        case 20: //Stormwind
            {
                if(plr->GetTeam() == 0)
                    Plr->SafeTeleport(0, 0, -9100.480469, 406.950745, 92.594185, 0);
            }break;
    
        case 21:
            //ironforge
            {
                if(plr->GetTeam() == 0)
                    Plr->SafeTeleport(0, 0, -5028.265137, -825.976563, 495.301575, 0);
                }break;
    
            case 22: //Exodar
            {
                if(plr->GetTeam() == 0)
                    Plr->SafeTeleport(1, 0, 9985.907227, 1971.155640, 1326.815674, 0);
                }break;
    
            case 23: //Darn
            {
                if(plr->GetTeam() == 0)
                    Plr->SafeTeleport(1, 0, 9985.907227, 1971.155640, 1326.815674, 0);
                }break;
    
            case 30: //org
                {
                    if(plr->GetTeam() == 1)
                        Plr->SafeTeleport(1, 0, 1371.068970, -4370.801758, 26.052483, 0);
                }break;
    
            case 31: //thunder bluff
                {
                    if(plr->GetTeam() == 1)
                        Plr->SafeTeleport(1, 0, -1304.569946, 205.285004, 68.681396, 0);
                }break;
    
            case 32: //Silvermoon
                {
                    if(plr->GetTeam() == 1)
                        Plr->SafeTeleport(530, 0, 9400.486328, -7278.376953, 14.206780, 0);
                }break;
    
            case 33: //undercity
                {
                    if(plr->GetTeam() == 1)
                        Plr->SafeTeleport(0, 0, 2050.203125, 285.650604, 56.994549, 0);
                }break;
    
            case 7: //Advance skills
    
                {
            uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
            if(currentgold>50000){
            int32 newgold = currentgold - 500000; //500 gold
            Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold);
            if (Plr->_HasSkillLine(43))
            {Plr->_AdvanceSkillLine(43, 350);}
            if (Plr->_HasSkillLine(55))
            {Plr->_AdvanceSkillLine(55, 350);}
            if (Plr->_HasSkillLine(44))
            {Plr->_AdvanceSkillLine(44, 350);}
            if (Plr->_HasSkillLine(95))
            {Plr->_AdvanceSkillLine(95, 350);}
            if (Plr->_HasSkillLine(54))
            {Plr->_AdvanceSkillLine(54, 350);}
            if (Plr->_HasSkillLine(45))
            {Plr->_AdvanceSkillLine(45, 350);}
            if (Plr->_HasSkillLine(46))
            {Plr->_AdvanceSkillLine(46, 350);}
            if (Plr->_HasSkillLine(136))
            {Plr->_AdvanceSkillLine(136, 350);}
            if (Plr->_HasSkillLine(160))
            {Plr->_AdvanceSkillLine(160, 350);}
            if (Plr->_HasSkillLine(162))
            {Plr->_AdvanceSkillLine(162, 350);}
            if (Plr->_HasSkillLine(172))
            {Plr->_AdvanceSkillLine(172, 350);}
            if (Plr->_HasSkillLine(173))
            {Plr->_AdvanceSkillLine(173, 350);}
            if (Plr->_HasSkillLine(176))
            {Plr->_AdvanceSkillLine(176, 350);}
            if (Plr->_HasSkillLine(226))
            {Plr->_AdvanceSkillLine(226, 350);}
            if (Plr->_HasSkillLine(228))
            {Plr->_AdvanceSkillLine(228, 350);}
            if (Plr->_HasSkillLine(229))
            {Plr->_AdvanceSkillLine(229, 350);}
            if (Plr->_HasSkillLine(473))
            {Plr->_AdvanceSkillLine(473, 350);}
            Plr->Gossip_Complete(); 
            }else{
            Plr->BroadcastMessage("Not enough gold hey? Pathetic!");
            }
            }break;
    
            case 8: //Explore maps
                {
            uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
            if(currentgold>15000){ //15 gold
            int32 newgold = currentgold - 15000;
            Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold);
            for (uint8 i=0; i<64; i++)
            {
            Plr->SetFlag(PLAYER_EXPLORED_ZONES_1+i,0xFFFFFFFF);
            }
            Plr->BroadcastMessage("Sight has a new meaning");
            Plr->Gossip_Complete();
            }else{
            Plr->BroadcastMessage("Well hurry up! %s I need that money now!");
            Plr->Gossip_Complete();
            }
            }break;
    
            case 9: //Buffs
                {
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
            
            Menu->AddItem(0, "Stamina", 70);
            Menu->AddItem(0, "Intellect", 71);
            Menu->AddItem(0, "Strength", 72);
            Menu->AddItem(0, "Agility", 73);
            Menu->SendTo(plr);
                }break;
    
                case 70: 
               { 
          uint32 price=5000;// 5 Silver
          uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE); 
          if (currentgold>=price){ 
          int32 newgold = currentgold - price;  
          Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold); 
                    Plr->CastSpell(Plr, 27062, 0); 
          Plr->BroadcastMessage("Buff added to %s" ); 
          }else{ 
             Plr->BroadcastMessage("Enjoy the power" ); 
          } 
          }break;
    
                           case 71: 
               { 
          uint32 price=5000;// 5 Silver
          uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE); 
          if (currentgold>=price){ 
          int32 newgold = currentgold - price;  
          Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold); 
                    Plr->CastSpell(Plr, 260261, 0); 
          Plr->BroadcastMessage("Buff added to %s" ); 
          }else{ 
             Plr->BroadcastMessage("Enjoy the power" ); 
          } 
          }break;
    
                           case 72: 
               { 
          uint32 price=5000;// 5 Silver
          uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE); 
          if (currentgold>=price){ 
          int32 newgold = currentgold - price;  
          Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold); 
                    Plr->CastSpell(Plr, 20266, 0); 
          Plr->BroadcastMessage("Buff added to %s" ); 
          }else{ 
             Plr->BroadcastMessage("Enjoy the power" ); 
          } 
          }break;
    
                           case 73: 
               { 
          uint32 price=5000;// 5 Silver
          uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE); 
          if (currentgold>=price){ 
          int32 newgold = currentgold - price;  
          Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold); 
                    Plr->CastSpell(Plr, 27976, 0); 
          Plr->BroadcastMessage("Buff added to %s" ); 
          }else{ 
             Plr->BroadcastMessage("Enjoy the power" ); 
          } 
          }break;
          }
        Plr->Gossip_Complete();
    };
    
    
    void MiscNPC::GossipEnd(Object * pObject, Player* Plr)
    {
        GossipScript::GossipEnd(pObject, Plr);
    }
    
    void SetupMiscNPC(ScriptMgr * mgr)
    {
        GossipScript * gs = (GossipScript*) new MiscNPC();
        mgr->register_item_gossip_script(MISCNPC, gs);
    }





    › See More: MiscNPC
    Last edited by Crux; 11-09-08 at 01:14 AM. Reason: left out a break;



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

  3. #2
    Senior Sergeant
    *Alexz*'s Avatar
    Join Date
    Aug 2008
    Posts
    107
    Post Thanks / Like
    Rep Power
    17
    Reputation
    33
    what emu dose this work with

  4. #3
    Grunt
    Wolfly's Avatar
    Join Date
    Aug 2008
    Location
    Estonia
    Posts
    33
    Post Thanks / Like
    Rep Power
    17
    Reputation
    19
    There's no code for All FP Unlocked. Menu item yeah but no function to it.

  5. #4
    Contributor
    StickyIcky's Avatar
    Join Date
    Jul 2008
    Location
    127.0.0.1
    Posts
    747
    Post Thanks / Like
    Rep Power
    19
    Reputation
    188

    great script man!

  6. #5
    Founder
    Apple's Avatar
    Join Date
    Jul 2008
    Location
    HeaveN
    Posts
    15,916
    Post Thanks / Like
    Rep Power
    10
    Reputation
    295
    Really nice job , keep it up +Rep





  7. #6
    Grunt

    Join Date
    Aug 2008
    Posts
    41
    Post Thanks / Like
    Rep Power
    17
    Reputation
    41
    what emu dose this work with
    Ascent, Arcemu and other ascent bases cores.

    There's no code for All FP Unlocked. Menu item yeah but no function to it.
    Ah my bad,thanks for telling me, flight path code added.

  8. #7
    Grunt
    Wolfly's Avatar
    Join Date
    Aug 2008
    Location
    Estonia
    Posts
    33
    Post Thanks / Like
    Rep Power
    17
    Reputation
    19
    No problem, and +Rep. You've earned it.

  9. #8
    Senior Sergeant
    *Alexz*'s Avatar
    Join Date
    Aug 2008
    Posts
    107
    Post Thanks / Like
    Rep Power
    17
    Reputation
    33
    also what are the setupfiles?

  10. #9
    Contributor
    StickyIcky's Avatar
    Join Date
    Jul 2008
    Location
    127.0.0.1
    Posts
    747
    Post Thanks / Like
    Rep Power
    19
    Reputation
    188
    lawl...if you dont know how to set up setup files dont bother...

    all i gotta say is:
    void SetupMiscNPC(ScriptMgr * mgr)

  11. #10
    Senior Sergeant
    *Alexz*'s Avatar
    Join Date
    Aug 2008
    Posts
    107
    Post Thanks / Like
    Rep Power
    17
    Reputation
    33

    Register to remove this ad
    well... im stupid so i need to know for future refrence!

 

 
Page 1 of 2 12 LastLast

Visitors found this page by searching for:

arcemu fp freischalten

SEO Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 06:44 PM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org