EDIT: Problem solved
EDIT: Problem solved
Last edited by skull5005; 09-25-2008 at 12:29 PM.
now the %5 is the chance the player will get a badge, u should find that block of code in PvPtoken.cpp and change it.Code:void onPvpKill(Player* pPlayer) { int die; die = rand()%5 + 1; if (die <= 1) {
Where would I find PvPtokens.cpp? I don't see any .cpp files anywhere >.>
Ohh, that. Here's what I have there:Where would i put what that block that you said?Code:void onPvpKill(Player* plr, Player* victim) { if( plr->GetTeam() != victim->GetTeam()) { char message[200]; sprintf(message, "%s has killed %s", plr->GetName(), victim->GetName()); sWorld.SendWorldWideScreenText(message); int32 gold_check_p = plr->GetUInt32Value( PLAYER_FIELD_COINAGE ); int32 gold_check_v = victim->GetUInt32Value( PLAYER_FIELD_COINAGE ); int32 new_gold_p = gold_check_p + 10000; int32 new_gold_v; if(gold_check_v < 5000) { new_gold_v = 0; } else { new_gold_v = gold_check_v - 5000; } plr->SetUInt32Value( PLAYER_FIELD_COINAGE, new_gold_p ); victim->SetUInt32Value( PLAYER_FIELD_COINAGE, new_gold_v ); } } void SetupPvPToken(ScriptMgr * mgr) { mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, (void*)onPvpKill); }
That's a quote, could you make it code please?
oh there sorry for that i think this is right!Code:void onPvpKill(Player* plr, Player* victim) { if( plr->GetTeam() != victim->GetTeam()) { char message[200]; sprintf(message, "%s has killed %s", plr->GetName(), victim->GetName()); sWorld.SendWorldWideScreenText(message); int32 gold_check_p = plr->GetUInt32Value( PLAYER_FIELD_COINAGE ); int32 gold_check_v = victim->GetUInt32Value( PLAYER_FIELD_COINAGE ); int32 new_gold_p = gold_check_p + 10000; int32 new_gold_v; if(gold_check_v < 5000) { new_gold_v = 0; } else { new_gold_v = gold_check_v - 5000; } plr->SetUInt32Value( PLAYER_FIELD_COINAGE, new_gold_p ); victim->SetUInt32Value( PLAYER_FIELD_COINAGE, new_gold_v ); } } void SetupPvPToken(ScriptMgr * mgr) { mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, (void*)onPvpKill); } void onPvpKill(Player* pPlayer) { int die; die = rand()%5 + 1; if (die <= 1) {
Change:
To:Code:die = rand()%5 + 1;
Then recompile and your set. That will allow your players to kill someone and receive the token every time.Code:die = + 1;
Excuse me scyther, like I said before, all I have isCould you please tell me where to add it, or add it for me so i can copy and paste?Code:void onPvpKill(Player* plr, Player* victim) { if( plr->GetTeam() != victim->GetTeam()) { char message[200]; sprintf(message, "%s has killed %s", plr->GetName(), victim->GetName()); sWorld.SendWorldWideScreenText(message); int32 gold_check_p = plr->GetUInt32Value( PLAYER_FIELD_COINAGE ); int32 gold_check_v = victim->GetUInt32Value( PLAYER_FIELD_COINAGE ); int32 new_gold_p = gold_check_p + 10000; int32 new_gold_v; if(gold_check_v < 5000) { new_gold_v = 0; } else { new_gold_v = gold_check_v - 5000; } plr->SetUInt32Value( PLAYER_FIELD_COINAGE, new_gold_p ); victim->SetUInt32Value( PLAYER_FIELD_COINAGE, new_gold_v ); } } void SetupPvPToken(ScriptMgr * mgr) { mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, (void*)onPvpKill); }![]()
Code:#include "StdAfx.h" #include "Setup.h" #define GOLD_AMOUNT 100000 //it is in copper #define PVP_TOKEN [ENTER YOUR ID] //Put Your Token ID Here void Token1(Player* plr, Player* victim) { if(plr->getLevel() >= 80 && victim->getLevel() >= 80 && plr->GetTeam() != victim->GetTeam()) { char message[200]; sprintf(message, "|cff00ff00[World PvP]|r |cffff0000%s|cffffffff(%i)|r has killed %s|cffffffff(%i)|r...This Is MADNESS!|r", plr->GetName(),plr->getLevel(), victim->GetName(),victim->getLevel()); sWorld.SendWorldWideScreenText(message); sLog.outColor(TRED,"n[WPVP]: WPVP Activated - the killer was %s...The victim was %s.", plr->GetName(), victim->GetName()); sLog.outColor(TNORMAL,"n"); int32 gold_check_p = plr->GetUInt32Value( PLAYER_FIELD_COINAGE ); int32 gold_check_v = victim->GetUInt32Value( PLAYER_FIELD_COINAGE ); int32 new_gold_p = gold_check_p + GOLD_AMOUNT; int32 new_gold_v; if(gold_check_v < GOLD_AMOUNT) { new_gold_v = 0; } else { new_gold_v = gold_check_v - GOLD_AMOUNT; } plr->SetUInt32Value( PLAYER_FIELD_COINAGE, new_gold_p ); plr->BroadcastMessage("You have gained 10 gold for this kill."); plr->CastSpell(plr, [CHOOSE A SPELL YOU WISH TO BE CASTED!], true); plr->PlaySoundToSet(11466); victim->SetUInt32Value( PLAYER_FIELD_COINAGE, new_gold_v ); victim->BroadcastMessage("You have lost 10 gold."); int die; die = + 1; if((die == 1) || (die == 2)) { plr->GetItemInterface()->SafeAddItem(PVP_TOKEN, INVENTORY_SLOT_NOT_SET, -1); Item * it = objmgr.CreateItem(PVP_TOKEN, plr); plr->GetItemInterface()->AddItemToFreeSlot(it); sLog.outColor(TGREEN,"[WPVP]: A Token was added for this kill to %s", plr->GetName()); sLog.outColor(TNORMAL,"n"); } else { sLog.outColor(TYELLOW,"[WPVP]: A Token was not added to %s", plr->GetName()); sLog.outColor(TNORMAL,"n"); } } } void SetupToken1(ScriptMgr * mgr) { mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, (void*)Token1); }
There is the one from arcemu.org This gives money and the token. Note: Edit the things in red.
Credits to them.
Last edited by Ickybad; 09-24-2008 at 07:10 PM.
o.O?Code:1>PvPToken.cpp 1>Linking... 1> Creating library ......binreleasescript_bin/ExtraScripts.lib and object ......binreleasescript_bin/ExtraScripts.exp 1>Setup.obj : error LNK2019: unresolved external symbol "void __cdecl SetupPvPToken(class ScriptMgr *)" (?SetupPvPToken@@YAXPAVScriptMgr@@@Z) referenced in function __exp_script_register 1>../../../bin/release/script_bin/ExtraScripts.dll : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://c:Documents and SettingsadminDesktopascenttrunksrcscriptsprojects2008_int_release_extrascriptsBuildLog.htm" 1>ExtraScripts - 2 error(s), 1 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Did you make your setup files?
Yes, I got the svn and everything.
Setup.CPP
Setup.hCode:#include "StdAfx.h" #include "Setup.h" #define SKIP_ALLOCATOR_SHARING 1 #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) { SetupToken1(mgr); } #ifdef WIN32 BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; } #endif
VCProjCode:#ifndef INSTANCE_SCRIPTS_SETUP_H #define INSTANCE_SCRIPTS_SETUP_H void SetupToken1(ScriptMgr * mgr); #endif
Code:<?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="9.00" Name="pvp" ProjectGUID="{25B8B9AE-2401-4F71-B946-26F6D3237443}" RootNamespace="pvp" Keyword="Win32Proj" TargetFrameworkVersion="131072" > <Platforms> <Platform Name="Win32" /> <Platform Name="x64" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="......bindebugscript_bin" IntermediateDirectory="2008_int_debug_pvp" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaultsUpgradeFromVC71.vsprops" CharacterSet="2" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" InlineFunctionExpansion="2" AdditionalIncludeDirectories="....ascent-shared;....ascent-world;......depinclude;......depsrc" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SCRIPTLIB" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="ascent-world.lib" OutputFile="../../../bin/debug/script_bin/pvp.dll" LinkIncremental="2" AdditionalLibraryDirectories="......bindebug" GenerateDebugInformation="true" ProgramDatabaseFile="../../../bin/debug/script_bin/pvp.pdb" SubSystem="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" ImportLibrary="$(OutDir)/pvp.lib" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMa****ol" /> <Tool Name="VCBscMa****ol" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Debug|x64" OutputDirectory="......bindebug_x64script_bin" IntermediateDirectory="2008_int_debug_pvp_x64" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaultsUpgradeFromVC71.vsprops" CharacterSet="2" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="0" InlineFunctionExpansion="2" AdditionalIncludeDirectories="....ascent-shared;....ascent-world;......depinclude;......depsrc" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SCRIPTLIB;X64;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="ascent-world.lib" OutputFile="../../../bin/debug_x64/script_bin/pvp.dll" LinkIncremental="2" AdditionalLibraryDirectories="......bindebug_x64" GenerateDebugInformation="true" ProgramDatabaseFile="../../../bin/debug_x64/script_bin/pvp.pdb" SubSystem="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" ImportLibrary="$(OutDir)/pvp.lib" TargetMachine="17" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMa****ol" /> <Tool Name="VCBscMa****ol" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="......bindebugscript_bin" IntermediateDirectory="2008_int_release_pvp" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaultsUpgradeFromVC71.vsprops" CharacterSet="2" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="4" InlineFunctionExpansion="2" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" OmitFramePointers="true" WholeProgramOptimization="true" AdditionalIncludeDirectories="....ascent-shared;....ascent-world;......depinclude;......depsrc" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SCRIPTLIB" StringPooling="true" RuntimeLibrary="2" BufferSecurityCheck="false" EnableFunctionLevelLinking="false" EnableEnhancedInstructionSet="0" FloatingPointModel="2" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="ascent-world.lib" OutputFile="../../../bin/release/script_bin/pvp.dll" LinkIncremental="1" AdditionalLibraryDirectories="......binrelease" GenerateDebugInformation="true" ProgramDatabaseFile="../../../bin/release/script_bin/pvp.pdb" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" OptimizeForWindows98="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" ImportLibrary="$(OutDir)/pvp.lib" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMa****ol" /> <Tool Name="VCBscMa****ol" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Release|x64" OutputDirectory="......binrelease_x64script_bin" IntermediateDirectory="2008_int_release_pvp_x64" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaultsUpgradeFromVC71.vsprops" CharacterSet="2" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="....ascent-shared;....ascent-world;......depinclude;......depsrc" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SCRIPTLIB;X64;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="ascent-world.lib" OutputFile="../../../bin/release_x64/script_bin/pvp.dll" LinkIncremental="1" AdditionalLibraryDirectories="......binrelease_x64" GenerateDebugInformation="true" ProgramDatabaseFile="../../../bin/release_x64/script_bin/pvp.pdb" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" ImportLibrary="$(OutDir)/pvp.lib" TargetMachine="17" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMa****ol" /> <Tool Name="VCBscMa****ol" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Main Resources" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > <File RelativePath="..srcpvpSetup.cpp" > </File> <File RelativePath="..srcpvpSetup.h" > </File> </Filter> <Filter Name="Scripts" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > <File RelativePath="..srcpvppvpsystem.cpp" > </File> </Filter> </Files> <Globals> </Globals> </VisualStudioProject>
man i need to comile this toooo! wish i knew how. How do i compile just it? I have compiled a core before, but not a single DLL
http://www.mmowned.com/forums/emulat...dll-video.html You can learn to compile a dll there mate.