• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Szybkość ataku

ancak

New Member
Joined
Oct 21, 2009
Messages
35
Reaction score
0
Location
Poland/ Jarosław
Witam, chciałbym dodać do skryptu linijkę, która zmienia graczom szybkość ataku na inna wartość - skrypt jest na reborn z tego forum
PHP:
function onSay(cid, words, param)
config = {
level=50, -- level necessary to reset.
RemainingLvl=8, -- that level will be reset after.
exper=4200, -- experience that will be reset after.
pid=getPlayerGUID(cid), 
skull="yes", -- players with white skull can reset? ("yes" or "no").
redskull="yes", -- players with red skull can reset? ("yes" or "no").
prot="yes", -- players need to be in protection zone to reset? ("yes" or "no").
bat="yes" --Players must be no fight to reset ("yes" or "no").
}

function getResets(cid)
reset = getPlayerStorageValue(cid,1020)
if reset < 0 then
reset = 0
end
return reset
end

local function getStats(cid, value)
	if value == "health" then
		return isKnight(cid) and getPlayerLevel(cid) * 15 + 65 or isPaladin(cid) and getPlayerLevel(cid) * 10 + 105 or (isSorcerer(cid) or isDruid(cid)) and getPlayerLevel(cid) * 5 + 145
	elseif value == "mana" then
		return isKnight(cid) and getPlayerLevel(cid) * 5 - 5 or isPaladin(cid) and getPlayerLevel(cid) * 15 - 85 or (isSorcerer(cid) or isDruid(cid)) and getPlayerLevel(cid) * 30 - 205
	end
end

if(config.skull == "no") and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"only players without white skull can reset.")
return TRUE
end

if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"only player without red skull can reset.")
return TRUE
end

if(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"you need stay in PZ to reset.")
return TRUE
end

if(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"players without battle can reset.")
return TRUE
end

if getPlayerLevel(cid) >= config.level then
setPlayerStorageValue(cid,1020,getResets(cid)+1)
doPlayerSetNameDescription(cid, " Have a "..getResets(cid)+(1).." reset\'s.")
doPlayerPopupFYI(cid,"you now was reset, you have "..getResets(cid)+(1).." reset\'s.")
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)
else
doPlayerSendCancel(cid, "You need to have level "..config.level.." or more you may be reset.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end

return TRUE
end

Ktoś mógłby mi wysłać linijkę kodu, która trzeba wpisać w ten kod aby było tak jak napisałem powyżej ?
ewentualnie wedle chęci przerobić ten skrypt tak by to działało.

Pozdrawiam.
 
Wolno to zrobić albo z modyfikacją w C++, lub z dodaniem nowych profesji, co wolisz?
 
Może być z dodaniem nowych profesji, tylko pytanie czy po którymś razie reborna dane nie będą się "gryzły" ?
 
Może być z dodaniem nowych profesji, tylko pytanie czy po którymś razie reborna dane nie będą się "gryzły" ?
Szczerze mówiąc to się nie opyla. Powiem mi jak to ma dodawać, ile punktów szybkości ataku na poziom, i w jakim storage'u trzymasz ilość rebornów.
 
Szkoda że nie nazwałeś tematu szybkie walenie, wtedy zapewne więcej osób by go odwiedziło.
 
Z każdym Możliwym rebornem szybkość by malała/wzrastała o 100 tj. jak jest szybkość ataku 1000 to żeby po rebornie było 900 itd

storage: 1020
 
Trochę przekombinowałem, ale sprawdź (player.cpp)
PHP:
uint32_t Player::getAttackSpeed()
{
	std::string value;
	
	Item* weapon = getWeapon();
	if(weapon && weapon->getAttackSpeed() != 0)
		return getStorage(1020, value) ? (weapon->getAttackSpeed() - 100 * atoi(value.c_str())) : weapon->getAttackSpeed();

	return getStorage(1020, value) ? (weapon->getAttackSpeed() - 100 * atoi(value.c_str())) : vocation->getAttackSpeed();
}
 
Back
Top