ok what do i change in a pvptoken script so it drops a different item?
http://www.mmowned.com/forums/emulat...r-own-dll.html
/\ using that guide /\
ok what do i change in a pvptoken script so it drops a different item?
http://www.mmowned.com/forums/emulat...r-own-dll.html
/\ using that guide /\
you have inserted something in your main config file. Like <Moon PvpTokenID="id">
its ok fixed it![]()
Allright :P
hey guys for some reason i get this any idea? http://i273.photobucket.com/albums/j...Untitled-1.jpg
post the token script please
you aint put your revision in it i think
/*
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("ascent_world", "70024", &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);
}
try change uint32 tokenItem = Config.MainConfig.GetInt("ascent_world", "70024", &itemID);
to uint32 tokenItem = Config.MainConfig.GetInt("ascentworld", "70024", &itemID);
if that doesent work then its your _exp_script_register, _exp_get_version, _exp_get_script_type. Said as your Setup.cpp and Setup.h, post them please.
it wont be the ascent_world because that has to match your database doesnt it
_exp_script_register, _exp_get_version, _exp_get_script_type
#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
in setup.cpp try add #include <ScriptSetup.h> in the top, if it still dont work, then it must be the StdAfx.h
idk what you mean....
like this Setup.cpp
Code:#include "StdAfx.h" #include "Setup.h" #include <ScriptSetup.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