Difference between revisions of "Manual:DIL Manual/weapon info()"

From DikuMUD Wiki
Jump to navigation Jump to search
(XML import)
 
(XML import)
 
Line 1: Line 1:
 +
<span id="bfweapon_info"></span>
 +
 +
'''Function:'''  <i><!--CODE-->intlist weapon_info( i : integer ) ;</i><!--ENDCODE-->
 +
 +
<!--TERM-->  '''i'''
 +
<!--DEFINITION-->        Weapon to get the info of ass defined in 'values.h' and 'weapons.def'
 +
<!--TERM-->  '''returns'''
 +
<!--DEFINITION-->        Intlist containing 4 values:
 +
 +
<!--TERM-->  '''0'''
 +
<!--DEFINITION-->        Number of hands
 +
<!--TERM-->  '''1'''
 +
<!--DEFINITION-->        weapon speed
 +
<!--TERM-->  '''2'''
 +
<!--DEFINITION-->        weapon type
 +
<!--TERM-->  '''3'''
 +
<!--DEFINITION-->        shield block value
  
  
 +
This function gives you access to the values in the weapons.def file.
 +
With this things like 'wear' equipment' and 'look' are much easier to
 +
write in Dil.
 +
'''Example'''
 +
<i><!--CODE-->
 +
---~---~---~---~---~---~---~---~---
 +
 +
dilcopy id_weap (arg:string);
 +
var
 +
  i:integer;
 +
  il:intlist;
 +
code
 +
dilend
 +
 +
 +
---~---~---~---~---~---~---~---~---
 +
 +
</i><!--ENDCODE-->
 
<span id="bfweapon_info"></span>
 
<span id="bfweapon_info"></span>
  
Line 32: Line 67:
 
   il:intlist;
 
   il:intlist;
 
  code
 
  code
{
+
dilend
il:=weapon_info(atoi(arg));
 
 
 
if (il!=null)
 
{
 
sendtext ("Number of hands:  "+itoa(il.[0])+"&amp;n";
 
              sendtext ("Speed:  " +itoa(il.[1])+"&amp;n",self);
 
                          sendtext ("Type:  "+itoa(il.[0])+"&amp;n",self);
 
                          sendtext ("Shield value:  "+itoa(il.[0])+"&amp;n",self);
 
                          }
 
else
 
{
 
sendtext ("No such weapon.&amp;n",self);
 
}
 
 
 
quit;
 
}
 
dilend
 
  
  

Latest revision as of 22:36, 4 December 2025

Function:  intlist weapon_info( i : integer ) ;
  i
         Weapon to get the info of ass defined in 'values.h' and 'weapons.def'
  returns
         Intlist containing 4 values:
  0
         Number of hands
  1
         weapon speed
  2
         weapon type
  3
         shield block value


This function gives you access to the values in the weapons.def file.
With this things like 'wear' equipment' and 'look' are much easier to
write in Dil.
Example

---~---~---~---~---~---~---~---~---
dilcopy id_weap (arg:string);
var
  i:integer;
  il:intlist;
code

dilend


---~---~---~---~---~---~---~---~---

Function:  intlist weapon_info( i : integer ) ;
  i
         Weapon to get the info of ass defined in 'values.h' and 'weapons.def'
  returns
         Intlist containing 4 values:
  0
         Number of hands
  1
         weapon speed
  2
         weapon type
  3
         shield block value


This function gives you access to the values in the weapons.def file.
With this things like 'wear' equipment' and 'look' are much easier to
write in Dil.
Example

---~---~---~---~---~---~---~---~---
dilcopy id_weap (arg:string);
var
  i:integer;
  il:intlist;
code

dilend


---~---~---~---~---~---~---~---~---