PvPToken award system problem. menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Zordin's Avatar Banned
    Reputation
    21
    Join Date
    Jan 2007
    Posts
    163
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PvPToken award system problem.

    Hey! I recently added the default PvPToken script from Extrascripts in ArcEmu to my server, its working and all, but sometimes it gives me 2 tokens instead of one. Heres my code:
    Code:
    /*
     * ArcScript Scripts for Arcemu MMORPG Server
     * Copyright (C) 2008 Arcemu Team
     * Copyright (C) 2007 Moon++ <http://www.moonplusplus.com/>
     *
     * This program is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * 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 General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */
    
    //Made by ???
    //Modified by WigSplitta whole code
    //Re-Modified by HalestormXV (Added More Features)
    //Random Dice Concept to Kuraria for Helping HalestormXV
    //Modified by Neo_mat
    
    #include "StdAfx.h"
    #include "Setup.h"
    
    #define TokenID 70000 //set token id here
    
    void onPvpKill(Player* pPlayer)
    {
        int die;
        die = rand()%5 + 1;
        if (die <= 1)
        {
            Item *item;
            item = objmgr.CreateItem( TokenID , pPlayer);
            item->SetUInt32Value(ITEM_FIELD_STACK_COUNT,1);
            item->SoulBind();
            if(!pPlayer->GetItemInterface()->AddItemToFreeSlot(item))
            {
                pPlayer->GetSession()->SendNotification("No free slots were found in your inventory!");
                item->DeleteMe();
            }
            else
            {
                SlotResult *lr = pPlayer->GetItemInterface()->LastSearchResult();
                pPlayer->GetSession()->SendItemPushResult(item,false,true,false,true,lr->ContainerSlot,lr->Slot,1);
            }
        }
    }
    
    void SetupPvPToken(ScriptMgr * mgr)
    {
        mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, (void*)onPvpKill);
    }
    I have no clue in c++ whatsoever, so it might be something obvious xD

    Also, is there any way to prevent this system from beeing abused? Like say, if u kill the same person 5 times in a certain amount of time, you will no onger get tokens for him?

    PvPToken award system problem.
  2. #2
    Algorithm's Avatar Member
    Reputation
    175
    Join Date
    Mar 2008
    Posts
    395
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Zordin View Post
    Hey! I recently added the default PvPToken script from Extrascripts in ArcEmu to my server, its working and all, but sometimes it gives me 2 tokens instead of one. Heres my code:
    Code:
    /*
     * ArcScript Scripts for Arcemu MMORPG Server
     * Copyright (C) 2008 Arcemu Team
     * Copyright (C) 2007 Moon++ <http://www.moonplusplus.com/>
     *
     * This program is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * 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 General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */
    
    //Made by ???
    //Modified by WigSplitta whole code
    //Re-Modified by HalestormXV (Added More Features)
    //Random Dice Concept to Kuraria for Helping HalestormXV
    //Modified by Neo_mat
    
    #include "StdAfx.h"
    #include "Setup.h"
    
    #define TokenID 70000 //set token id here
    
    void onPvpKill(Player* pPlayer)
    {
        int die;
        die = rand()%5 + 1;
        if (die <= 1)
        {
            Item *item;
            item = objmgr.CreateItem( TokenID , pPlayer);
            item->SetUInt32Value(ITEM_FIELD_STACK_COUNT,1);
            item->SoulBind();
            if(!pPlayer->GetItemInterface()->AddItemToFreeSlot(item))
            {
                pPlayer->GetSession()->SendNotification("No free slots were found in your inventory!");
                item->DeleteMe();
            }
            else
            {
                SlotResult *lr = pPlayer->GetItemInterface()->LastSearchResult();
                pPlayer->GetSession()->SendItemPushResult(item,false,true,false,true,lr->ContainerSlot,lr->Slot,1);
            }
        }
    }
    
    void SetupPvPToken(ScriptMgr * mgr)
    {
        mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, (void*)onPvpKill);
    }
    I have no clue in c++ whatsoever, so it might be something obvious xD

    Also, is there any way to prevent this system from beeing abused? Like say, if u kill the same person 5 times in a certain amount of time, you will no onger get tokens for him?
    is 70000 Item Id is your custom token item id that you made?

  3. #3
    Zordin's Avatar Banned
    Reputation
    21
    Join Date
    Jan 2007
    Posts
    163
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, im getting the token and all that is working, but sometimes i get 2 tokens of one kill

Similar Threads

  1. Problem with online players script and vote system
    By Obly in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 09-29-2010, 03:16 AM
  2. PvPToken System! (Need Script Edited)
    By Performer in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 02-03-2008, 06:10 PM
  3. Site problems
    By Shanaar in forum Community Chat
    Replies: 10
    Last Post: 05-14-2006, 01:15 AM
  4. Awards
    By oninuva in forum Suggestions
    Replies: 16
    Last Post: 05-12-2006, 12:42 PM
  5. Replies: 0
    Last Post: 03-24-2006, 01:43 AM
All times are GMT -5. The time now is 01:49 PM. 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