• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Strength of Weapons

jestemPolakiem

New Member
Joined
Oct 17, 2009
Messages
48
Reaction score
2
Location
Poland
translatelogo.gif
StrengthofWeapons
created by jestemPolakiem

mapazk.png


Introduction
Welcome all members of this forum! I would like to give you my newly-created script.​
However, before I do I want to emphasize that all the errors in my posts are due to incorrect translation. Any post that is explained, will include the icon at the top, right corner.​

Description
As for the script itself It can also be added to each item attacking strength. If she is going to end weapons destruction. Weapons of newly purchased and newly-acquired, which is not yet in use has no description - only when activation is added - the maximum strength is calculated with the following formula​
PHP:
math.floor((getItemInfo(weapon.itemid).attack * getItemInfo(weapon.itemid).defense) / 13)

Changelog
  • improve the problem of checking whether the player uses this function - thanks to Cykotitan
  • checking whether the improved strength does not cross the border - thanks to Cykotitan

Install
data/creaturescripts/creaturescripts.xml
PHP:
<event	type="attack"			name="JPAxC001"				event="script" value="JPAxC001.lua"				/>
data/creaturescripts/script/login.lua
PHP:
registerCreatureEvent(cid, "JPAxC001")
data/creaturescripts/script/JPAxC001.lua
PHP:
function onAttack(cid, target)
	local weapon, desc = getPlayerWeapon(cid, true), ""
	
	if (not isPlayer(cid)) then						
		return true
	end
	local weapon_strength = math.min(1000, math.floor((getItemInfo(weapon.itemid).attack * getItemInfo(weapon.itemid).defense) / 13))
	if (not getItemAttribute(weapon.uid, "aid")) then	
		doItemSetAttribute(weapon.uid, "aid", 1000 + weapon_strength)
	end
	doItemSetAttribute(weapon.uid, "aid", getItemAttribute(weapon.uid, "aid") - 1)
	doItemSetAttribute(weapon.uid, "description", "\nStrength of your arms is "..(getItemAttribute(weapon.uid, "aid")-1000).." attackable.")
	if ((getItemAttribute(weapon.uid, 'aid')-1000) == 1) then			
		doRemoveItem(weapon.uid, 1) 
	end
	return true
end

Termination
I greet all​
jestemPolakiem​
 
Last edited:
translatelogo.gif
Existance, This is my own ID I could distinguish between scripts and sort them
 
Last edited:
i understand that, but why make it complicated?
do you even understand that ppl might get confused with this code i dont mean the entire skrypt. i mean the "JPAxC001"
 
this can be removed because it's only executed for players, so cid is always a player
Code:
    if (not isPlayer(cid)) then                        
        return true
    end

and
Code:
    local weapon_strength = math.floor((getItemInfo(weapon.itemid).attack * getItemInfo(weapon.itemid).defense) / 13) 
    if (weapon_strength > 1000)    then                            
        weapon_strength = 1000 
    end
=
Code:
    local weapon_strength = math.min(1000, math.floor((getItemInfo(weapon.itemid).attack * getItemInfo(weapon.itemid).defense) / 13))
 
i understand that, but why make it complicated?
do you even understand that ppl might get confused with this code i dont mean the entire skrypt. i mean the "JPAxC001"

Do you really think that people care? Most of them do only copy & paste.
 
I already know that they just copy/paste. Some people just copy/paste and some like complaining. XD fuck dont can do write the word "complain".
 
translatelogo.gif
Cykotitan, Thanks for the tips - I added you in the changelog.
Chojrak and Existance, I do not think such a thing could be subject to discussion. Some copy and paste - and those who need to analyze the change as they do not like. That's the name is only a name is complicated as the majority.
 
translatelogo.gif
Existance, dear friend is described in the first post - at the top - let me quote
However, before I do I want to emphasize that all the errors in my posts are due to incorrect translation. Any post that is explained, will include the icon at the top, right corner.
 
Last edited:
Yeah man, leave this guy alone, its a nice script!

Would we have turned away great literature because we didnt like the font?

If you dont know how to manage an Otserv /data foler, how can you even tell what this is for?

Btw, what is this for? HA (I never said I was all there)
 
Yeah man, leave this guy alone, its a nice script!

Would we have turned away great literature because we didnt like the font?

If you dont know how to manage an Otserv /data foler, how can you even tell what this is for?

Btw, what is this for? HA (I never said I was all there)
_?!_!?_?!_!?_?!_!?_?!_!?_
 
Back
Top Bottom