[HELP] PVP Script Question menu

Shout-Out

User Tag List

Results 1 to 9 of 9
  1. #1
    Darksid's Avatar Member
    Reputation
    19
    Join Date
    Jun 2008
    Posts
    375
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [HELP] PVP Script Question

    In the pvp script what do you change to make that item drop. Like i want my pvp token to drop 70024. Where in the source/script w/e its called do you change the item id..



    /*
    PvP Token Plug-in, this plug in will add a token of your choice to the killer of the opposite faction.
    Copyright (C) 2008 Plexor/zxc

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.
    Credits to NCDB for original Source
    Credits to me for modifying it
    */
    #include "StdAfx.h"
    #include "Setup.h"

    void onPvpKill(Player* plr, Player* victim)
    {
    int itemID;
    uint32 tokenItem = Config.MainConfig.GetInt("NCDB", "PvPTokenID", &itemID);

    sLog.outColor(TGREEN,"n[NCDB] (%u)%s killed (%u)%s", plr->getLevel(), plr->GetName(), victim->getLevel(), victim->GetName());
    char onkill[1024];
    snprintf((char*)onkill, 1024, "[PVP]%s has killed %s", plr->GetName(), victim->GetName());
    sWorld.SendWorldWideScreenText(onkill);

    if(plr->getLevel() >= 70 && victim->getLevel() >= 70 && plr->GetTeam() != victim->GetTeam())
    {
    sLog.outColor(TGREEN,"n[NCDB] Adding token to %s", plr->GetName());
    sLog.outColor(TNORMAL,"n");
    ItemPrototype *proto = ItemPrototypeStorage.LookupEntry(itemID);
    SlotResult slotresult;
    slotresult = plr->GetItemInterface()->FindFreeInventorySlot(proto);

    if(!slotresult.Result)
    {
    plr->GetItemInterface()->BuildInventoryChangeError(NULL, NULL, INV_ERR_INVENTORY_FULL);
    }
    else
    {
    Item *itm = objmgr.CreateItem(itemID, plr);
    itm->SetUInt32Value(ITEM_FIELD_STACK_COUNT, 1);
    plr->GetItemInterface()->SafeAddItem(itm,slotresult.ContainerSlot, slotresult.Slot);
    plr->SaveToDB(false);
    }
    }
    else
    {
    sLog.outColor(TGREEN,"n[NCDB] Not adding token since they both are not level 70");
    sLog.outColor(TNORMAL,"n");
    }
    }

    void SetupPvPToken(ScriptMgr * mgr)
    {
    mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, onPvpKill);
    }

    [HELP] PVP Script Question
  2. #2
    Kiyoshi's Avatar Member
    Reputation
    28
    Join Date
    Jun 2008
    Posts
    192
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It might help people help you if it was in [code] tags

    I also believe you configure this line:

    Code:
    uint32 tokenItem = Config.MainConfig.GetInt("NCDB", "PvPTokenID", &itemID);

  3. #3
    Darksid's Avatar Member
    Reputation
    19
    Join Date
    Jun 2008
    Posts
    375
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok i got it to work but im getting this in ascent





    #ifndef PvPToken_SETUP_H
    #define PvPToken_SETUP_H

    void SetupPvPToken(ScriptMgr * mgr);

    #endif

    #include "StdAfx.h"
    #include "Setup.h"


    extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
    {
    return SCRIPT_TYPE_MISC;
    }

    extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
    {
    SetupPvPToken(mgr);

    }

    #ifdef WIN32

    BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
    {
    return TRUE;
    }

    #endif
    there you go

    Ok I Fixed The Problem With The Loading, But Now When I Kill Someone In Pvp The Server Disconnects Everyone!
    Last edited by 2dgreengiant; 07-02-2008 at 07:18 PM.

  4. #4
    soul02's Avatar Active Member
    Reputation
    33
    Join Date
    Mar 2008
    Posts
    168
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    u dont need to change anything in the pvptoken.cpp

    just put this in ascent-world.conf <NCDB PvPToken="1" PvPTokenID="70024">
    -·=»‡«=·- Soul02 -·=»‡«=·-


  5. #5
    Darksid's Avatar Member
    Reputation
    19
    Join Date
    Jun 2008
    Posts
    375
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok the dll loads now, but now whenever someone kills another person they get a disconnection...

  6. #6
    soul02's Avatar Active Member
    Reputation
    33
    Join Date
    Mar 2008
    Posts
    168
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    did u make any change in the .cpp?
    -·=»‡«=·- Soul02 -·=»‡«=·-


  7. #7
    Darksid's Avatar Member
    Reputation
    19
    Join Date
    Jun 2008
    Posts
    375
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no i just copy and pasted the source thats all

  8. #8
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Item *itm = objmgr.CreateItem(itemID, plr);
    Should be tokenitem, not itemID. Take a look at the first few lines - itemID is never assigned anything

  9. #9
    Darksid's Avatar Member
    Reputation
    19
    Join Date
    Jun 2008
    Posts
    375
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my players are still getting a instant disconnection when they kill eachother!

Similar Threads

  1. WoW AFK-PvP Script - Question
    By AkaMAtzi in forum WoW Bots Questions & Requests
    Replies: 1
    Last Post: 04-16-2010, 07:16 AM
  2. [HELP] Cant get PVP Scripts to work(REPOST)
    By Darksid in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 07-04-2008, 01:16 PM
  3. Lua script help and general questions from beginner
    By WinKIller0 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 02-23-2008, 04:38 AM
  4. help with scripts
    By orangegold in forum World of Warcraft General
    Replies: 0
    Last Post: 03-28-2007, 05:50 PM
  5. quick mac script question
    By lars1414 in forum World of Warcraft General
    Replies: 0
    Last Post: 12-28-2006, 02:37 PM
All times are GMT -5. The time now is 09:45 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search