• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Request] A Race System for Clients 8.52

tabz23

New Member
Joined
Sep 3, 2009
Messages
66
Reaction score
0
Well im making what you would call a WoW Server and i have searched everywhere but haven't found one.

I only need a Race system that adds :

Horde and Alliance

The details of the race system do not need to be very detailed. The only thing i ask is if someone can please make it so that when you dobleclick on someone it says
"You see God Tabz. He is a Mage from the Horde." or however it is that it goes.
The other feature i request is that you cannot attack members from your own team (meaning horde or alliance)...

I understand there is source editing needed, if so please be very clear with what i need to do because my knowledge of source editing is very limited >.<

Thanks to whoever manages to do this! :D
 
Thanks! ill try out the town thing it helped me understand some things, but as for the vocations.xml and the onAttack thing can you explain to me a little more?
I dont see any function i can use in vocations and maybe you could help me with the onAttack script please? =]

Thanks alot! ill rep you!!
 
Well, vocations would be much longer, you'd have to add new mages for each thing, like;


PHP:
	<vocation id="0" name="Mage From The Horde" description="mage from the Thorde" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
	</vocation>

and


PHP:
	<vocation id="1" name="Mage From Alliance" description="mage from alliance" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
	</vocation>

and the onattack part would be

Lua:
function onAttack(cid, target)

	if isInArray({vocations of the horde}, getPlayerVocation(cid)) and isInArray({vocations of the horde}, getPlayerVocation(target)) or isInArray({vocations of alliance}, getPlayerVocation(cid)) and isInArray({vocations of alliance}, getPlayerVocation(target)) then
		doPlayerSendCancel(cid, "You can't attack someone from the same side")
		return 0
	end
end
 
ahhh sorry i didnt see your post here santy thanks,

well i tried your code out and it got a little closer...

ok let me explain...

ally vs ally < the player can get pk but he doesnt do any damage... thats fine with me

but when its

ally vs horde: it gives out the cancel message that you gave me and doesnt let them attack each other either...

you think you can fix it? >.< i want it so allys cant attack and hordes cant attack each other but they can attack the enemy side

please help!!! ill repp!!! :D


EDIT: hey santy i put vocations notattackable and they didnt attack each other O_O well duhh on my side but yea :p

and i had all the vocations made already :D

1-4 is horde mage,horde druid, horde hunter, horde knight and alliance is 5-8

still not working it has the error i told you above >.< think you can help?

and MERRY CHRISTMAS! :p
 
Last edited:
Perhaps you configured it wrong. I made it easier to configure.

Code:
function onAttack(cid, target)
	vocations = {
	horde = {1, 3, 5, 7},
	alliance = {2, 4, 6, 8}
}

	if isInArray(vocations.horde, getPlayerVocation(cid)) and isInArray(vocations.horde, getPlayerVocation(target)) or isInArray(vocations.alliance, getPlayerVocation(cid)) and isInArray(vocations.alliance, getPlayerVocation(target)) then
		doPlayerSendCancel(cid, "You can't attack someone from the same side")
		return 0
	end
	return 1
end

If you want, you can post your vocations.xml and I can do it for you.
 
so wait do you want me to put the vocations attackable or not?

and i have them 1-4 horde and 5-8 alliance :p

EDITTT: GOT IT WORKINGGG THANK YOU SO MUCH SANTY!!!!!!!!!

The ONLY issue is that when you attack someone from your same side they get skull and pz lock but they dont get any damage taken away :p
 
Last edited:
hey santy, i already got the script working thanks so much i repped you :D


i was also wondering, when you do area spells or aim a regular spell like exori frigo, it doesnt take effect theres still damage done...
cybermaster told me this was possible if i make an onStatschange script and he made one for me but its still not working, do you think you can help me out with it?

here it is

PHP:
  function onStatsChange(cid, attacker, type, combat, value)
local mages, warriors = {1, 2, 3, 4}, {5, 6, 7, 8}

     if type == STATSCHANGE_HEALTHLOSS and (isInArray(mages, getPlayerVocation(cid)) and isInArray(mages, getPlayerVocation(attacker)) or (isInArray(warriors, getPlayerVocation(cid)) and isInArray(warriors, getPlayerVocation(attacker)))) then
        return 0
     end
       return 1
end

i already tested by messing around with the return trues and all that stuff but it doesnt work... the other thing my server gave me some error with the stats here it is

Code:
[24/12/2009 12:39:44] Lua Script Error: [CreatureScript Interface] 
[24/12/2009 12:39:44] data/creaturescripts/scripts/AreaProtection.lua:onStatsChange

[24/12/2009 12:39:44] internalGetPlayerInfo(). Player not found

[24/12/2009 12:39:44] Lua Script Error: [CreatureScript Interface] 
[24/12/2009 12:39:44] data/creaturescripts/scripts/AreaProtection.lua:onStatsChange

[24/12/2009 12:39:44] internalGetPlayerInfo(). Player not found

any help?
 
Use these instead:

Lua:
local vocations = {
	horde = {1, 3, 5, 7},
	alliance = {2, 4, 6, 8}
}

function onCombat(cid, target)
	if isInArray(vocations.horde, getPlayerVocation(cid)) and isInArray(vocations.horde, getPlayerVocation(target)) or isInArray(vocations.alliance, getPlayerVocation(cid)) and isInArray(vocations.alliance, getPlayerVocation(target)) then
		doPlayerSendCancel(cid, "You can't attack someone from the same side.")
		return 0
	end
	return 1
end

function onTarget(cid, target)
	if isInArray(vocations.horde, getPlayerVocation(cid)) and isInArray(vocations.horde, getPlayerVocation(target)) or isInArray(vocations.alliance, getPlayerVocation(cid)) and isInArray(vocations.alliance, getPlayerVocation(target)) then
		doPlayerSendCancel(cid, "You can't attack someone from the same side.")
		return 0
	end
	return 1
end

Add both onTarget and onCombat to creaturescripts.xml and to login.lua.
 
Bro Santy i just tried it and it worked! you are friggin amazing!

<3333333333333333333 NO HOMO lol

THanks alot man i repped you likee hellll!!!! thanks man it works perfectly no bugs no nothing! now i can complete my wow server! this is all i was missing and some spells of course but at least i can start it now and get some more work on it! and no source editing needed xD thank you so much man! =D!


EDIT! I get alot of errors every a monster is attacked... im guessing its because it doesnt check if its a player or not, think you can add that to both scripts? =) im sure its not that hard i just suck at scripting.. i can only understand scripts i cant really create them or something.
 
Last edited:
Where exactly would i put it?

PHP:
local vocations = {
        horde = {1, 2, 3, 4},
        alliance = {5, 6, 7, 8}
}

function onCombat(cid, target)
        if isInArray(vocations.horde, getPlayerVocation(cid)) and isInArray(vocations.horde, getPlayerVocation(target)) or isInArray(vocations.alliance, getPlayerVocation(cid)) and isInArray(vocations.alliance, getPlayerVocation(target)) then
                doPlayerSendCancel(cid, "You can't attack someone from the same side.")
                return 0
        end
        return 1
end

i dont know exactly where to put it :p sorry for the nubness lol
 
Back
Top