Likes: 0
Results 1 to 6 of 6
Thread: PVP Script
-
25-07-08, 02:33 AM #1
PVP Script
Register to remove this adThis script is kind of hard to explain.
When a player kills another player that is not in the same faction as him (Alli vs Horde, Horde vs Alli) he gets 10 gold from the person who died. And also has a 30% chance to get a PVP Token.
All you have to do is edit the defines that are up top.
Code://Made by ??? //Modified by WigSplitta //Version 1.1 #include "StdAfx.h" #include "Setup.h" #define GOLD_AMOUNT 100000 //Amount of gold that player gets and victim loses //Example: If you want them to get/lose 100 gold, you take 10000 x 100 which would be 1000000 copper #define PVP_TOKEN 29434 //The Item ID of the PVP Token #define DROP_CHANCE1 30 //Put the Drop Percent you want void onPvpKill(Player* plr, Player* victim) { if( plr->GetTeam() != victim->GetTeam()) { 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 ); victim->SetUInt32Value( PLAYER_FIELD_COINAGE, new_gold_v ); int chance = RandomUInt(99)+1; #define DROP_CHANCE2 DROP_CHANCE1+1 if(chance < DROP_CHANCE2) //30% drop rate plr->GetItemInterface()->AddItemToFreeSlot(objmgr.CreateItem(PVP_TOKEN, plr)); } } void SetupPvPToken(ScriptMgr * mgr) { mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, (void*)onPvpKill); }
› See More: PVP Script
-
29-07-08, 11:29 PM #2
-
31-07-08, 05:31 AM #3
- Rep Power
- 17
- Reputation
- 11
I think GastricPenguin made this<br>
-
01-08-08, 01:51 PM #4
-
31-08-08, 09:06 AM #5
I've just installed it into my testing server, and it seems not to work, does this have any specific requirements?
-
31-08-08, 10:57 PM #6
Register to remove this adIt works in my server...and i use AscentEmu rev 4035 or something like that...