Hello,
Today i want release an PvP System.
PVP System
_______________________________
Credits to:
_______________________________
*Cykotitan, for general help
*PhoOwned, for Skull Appear part
*Oskar1121, for C++ part
_______________________________
What this system do?
_______________________________
- If you have securemode off
, you CANNOT attack/target enemy players with melee damage and area/wave spells. If your area spells or wave is near player or falls on him, you DONT receive White Skull & enemy dont receive damage (Spells ignore enemy player).
- If you have securemode on
, you CAN attack/target enemy players. Your area/wave spells are dealing damage to players and you receive White Skull.
_______________________________
How I can add this?
Follow this steps:
_______________________________
1) Add this function in C++ : getPlayerSecureMode using this thread: http://otland.net/f35/getplayersecuremode-cid-getplayerfightmode-cid-128276/
2) Now you must add these 2 scripts to CreatureEvents :
- Create in ~\data\creaturescripts\scripts an LUA file called raczka.lua, and paste this script:
- Now, create in ~\data\creaturescripts\scripts an LUA file called raczka1.lua, and paste this script:
3) Now you must declare this in creaturescripts.xml:
4) You must add/declare the script in login.lua:
[Add before return true]
That's all.
Now if you have securemode off you cannot attack other players with melee and area/wave spells (you dont receive skull).
If you have securemode on your spells deal damage to players and you receive skull and you can attack with melee (can target enemy player). :w00t:
Today i want release an PvP System.
PVP System
_______________________________
Credits to:
_______________________________
*Cykotitan, for general help
*PhoOwned, for Skull Appear part
*Oskar1121, for C++ part
_______________________________
What this system do?
_______________________________
- If you have securemode on
_______________________________
How I can add this?
Follow this steps:
_______________________________
1) Add this function in C++ : getPlayerSecureMode using this thread: http://otland.net/f35/getplayersecuremode-cid-getplayerfightmode-cid-128276/
2) Now you must add these 2 scripts to CreatureEvents :
- Create in ~\data\creaturescripts\scripts an LUA file called raczka.lua, and paste this script:
Lua:
function onTarget(cid, target)
if(attacker and isPlayer(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and getPlayerSecureMode(attacker)) then
return false
end
return true
end
function onStatsChange(cid, attacker, type, combat, value)
if(attacker and isPlayer(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and getPlayerSecureMode(attacker)) then
if combat ~= COMBAT_HEALING then
return false
end
end
return true
end
function onCast(cid, target)
if(attacker and isPlayer(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and getPlayerSecureMode(attacker)) then
if combat ~= COMBAT_HEALING then
return false
end
end
return true
end
- Now, create in ~\data\creaturescripts\scripts an LUA file called raczka1.lua, and paste this script:
Lua:
function onCombat(cid, target)
if(target and isPlayer(target) and getPlayerSecureMode(cid)) then
doPlayerSendCancel(cid, "Turn secure mode off if you really want to attack unmarked players.")
return false
end
return true
end
3) Now you must declare this in creaturescripts.xml:
XML:
<event type="statschange" name="Raczka" event="script" value="raczka.lua"/>
<event type="target" name="RaczkaTarget" event="script" value="raczka.lua"/>
<event type="cast" name="RaczkaCast" event="script" value="raczka.lua"/>
<event type="combat" name="RaczkaSkull" event="script" value="raczka1.lua"/>
4) You must add/declare the script in login.lua:
[Add before return true]
Lua:
registerCreatureEvent(cid, "Raczka")
registerCreatureEvent(cid, "RaczkaTarget")
registerCreatureEvent(cid, "RaczkaCast")
registerCreatureEvent(cid, "RaczkaSkull")
That's all.
Now if you have securemode off you cannot attack other players with melee and area/wave spells (you dont receive skull).
If you have securemode on your spells deal damage to players and you receive skull and you can attack with melee (can target enemy player). :w00t:
Last edited: