daredevil 发表于 2008-12-8 14:50:34

胜利之日DOD魔兽插件问题请教

此插件包原文件,在压缩包内,不知道怎么修改。

商店2中的:灼烧手套购买后就会出现当机现象,是否可以将他关闭或者设置成他们无法购买。

请高手解答谢谢。

lanmao 发表于 2008-12-8 22:52:10

回复: 胜利之日DOD魔兽插件问题请教

你可以给他改成999999一个让他们金钱不够无法购买或者去掉这个道具.

建议还是改价钱 比较简单

daredevil 发表于 2008-12-8 23:29:55

回复: 胜利之日DOD魔兽插件问题请教

那就麻烦下你帮忙修改下啊,我改不了,不知道是那个文件。

daredevil 发表于 2008-12-9 00:01:06

回复: 胜利之日DOD魔兽插件问题请教

我修改了里面的钱但无法编译出来AMXX,提示出错,我晕。

daredevil 发表于 2008-12-9 00:08:43

回复: 胜利之日DOD魔兽插件问题请教

/*疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.
* Item Functions
疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.疮`?父.*/
// Item Setup Functions
ITEM_Init()
{
ITEM_COST   = 1500;   // Ankh of Reincarnation
ITEM_COST       = 2500;   // Boots of Speed
ITEM_COST   = 1000;   // Claws of Attack
ITEM_COST   = 800;   // Cloak of Shadows
ITEM_COST   = 2000;   // Mask of Death
ITEM_COST = 800;   // Necklace of Immunity
ITEM_COST   = 2000;   // Orb of Frost
ITEM_COST   = 1000;   // Periapt of Health
ITEM_COST   = 4000;   // Tome of Experience
ITEM_COST   = 6000;   // Scroll of Respawning
ITEM_COST = 1500;   // Mole Protectant
ITEM_COST   = 3000;   // Helm of Excellence
ITEM_COST   = 1500;   // Amulet of the Cat
ITEM_COST   = 1500;   // Sock of the Feather
ITEM_COST   = 1750;   // Flaming Gloves of Warmth
ITEM_COST   = 1000;   // Ring of Regeneration + 1
ITEM_COST = 4500;   // Chameleon
ITEM_COST   = 16000;// Mole
// Item costs are a little different for DOD
if ( g_MOD == GAME_DOD )
{
ITEM_COST = 800;
}
// Items are chargeable
g_iFlag |= ITEM_CHARGEABLE;
g_iFlag|= ITEM_CHARGEABLE;
g_iFlag|= ITEM_CHARGEABLE;
// Items should be used when bought
g_iFlag|= ITEM_USEONBUY;
// Items CAN be bought when dead
g_iFlag|= ITEM_BUYWHENDEAD;
g_iFlag |= ITEM_BUYWHENDEAD;
g_iFlag|= ITEM_BUYWHENDEAD;
g_iFlag|= ITEM_BUYWHENDEAD;
// Items are used when the next round starts...
g_iFlag|= ITEM_NEXTROUNDUSE;
g_iFlag|= ITEM_NEXTROUNDUSE;
}
// We created this to allow for different prices of items at different levels
ITEM_Cost( id, iItem )
{
// How much should ratio increase per level?
new Float:fInc = ( 1.0 - ITEM_COST_RATIO ) / float( MAX_LEVELS );
// Cost * ratio (ITEM_COST_RATIO to 1.0 dependent on level)
new Float:fRatio = (float( p_data ) * fInc) + ITEM_COST_RATIO;
return floatround( float( ITEM_COST ) * fRatio );
}

public ITEM_CanBuy( id, iItem )
{
// User doesn't have the money
if ( SHARED_GetUserMoney( id ) < ITEM_Cost( id, iItem ) )
{
client_print( id, print_center, "%L", id, "INSUFFICIENT_FUNDS" );
return false;
}

// User already owns the item and it's not a chargeable item!
else if ( ITEM_Has( id, iItem ) > ITEM_NONE && !ITEM_CheckFlag( iItem, ITEM_CHARGEABLE ) )
{
client_print( id, print_center, "%L", id, "ALREADY_OWN_THAT_ITEM" );
return false;
}

// Make sure these items can be bought if the user is dead
else if ( !is_user_alive( id ) && !ITEM_CheckFlag( iItem, ITEM_BUYWHENDEAD ) )
{
client_print( id, print_center, "%L", id, "NOT_PURCHASE_WHEN_DEAD" );
return false;
}

// User has necklace + blink, they don't need a necklace
else if ( iItem == ITEM_NECKLACE && p_data_b )
{
client_print( id, print_center, "You are already immune to ultimates through one of your skills!" );
return false;
}
// User doesn't need an ankh if they're going to reincarnate
else if ( iItem == ITEM_ANKH && SM_GetSkillLevel( id, SKILL_REINCARNATION ) == 3 && !p_data )
{
client_print( id, print_center, "You will already reincarnate your weapons through one of your skills!" );
return false;
}

// User has purchased the maximum allowed rings
else if ( g_iTotalRings >= 5 && iItem == ITEM_RING )
{
client_print( id, print_center, "%L", id, "NOT_PURCHASE_MORE_THAN_FIVE_RINGS" );
return false;
}
// User has purchased gloves when they're disabled on this map
else if ( iItem == ITEM_GLOVES && g_bGlovesDisabled )
{
client_print( id, print_chat, "Gloves are disabled on this map!" );
return false;
}
// User is already going to reincarnate weapons because they bought an ankh earlier (probably lost it when died)
else if ( ( iItem == ITEM_ANKH && g_bPlayerBoughtAnkh ) || ( iItem == ITEM_MOLE && g_bPlayerBoughtMole ))
{
client_print( id, print_center, "%L", id, "ALREADY_OWN_THAT_ITEM" );
return false;
}
return true;
}
public ITEM_Buy( id, iItem )
{

// If the user can buy this item...
if ( ITEM_CanBuy( id, iItem ) )
{
// User's items are full
if ( ITEM_GetSlot( id ) == ITEM_SLOT_FULL && !ITEM_CheckFlag( iItem, ITEM_USEONBUY ) )
{
   // We only care about items being full if this item isn't a use on buy
   if ( !ITEM_CheckFlag( iItem, ITEM_USEONBUY ) )
   {
    new bool:bShowReplaceMenu = false;
    // One time use...
    if ( !ITEM_CheckFlag( iItem, ITEM_CHARGEABLE ) )
    {
   //client_print( id, print_chat, " Item is not chargeable" );
   bShowReplaceMenu = true;
    }
    // We also need to replace it if the item is chargeable but they don't own that item
    if ( ITEM_Has( id, iItem ) == ITEM_NONE && ITEM_CheckFlag( iItem, ITEM_CHARGEABLE ) )
    {
   //client_print( id, print_chat, " Doesn't have item and new item is chargeable" );
   bShowReplaceMenu = true;
    }
    if ( bShowReplaceMenu )
    {
   g_iFutureItem = iItem;
   MENU_ReplaceItem( id );
   return;
    }
   }
}

// We're clear!
// Remove user's money
new iNewMoney = SHARED_GetUserMoney( id ) - ITEM_Cost( id, iItem );
SHARED_SetUserMoney( id, iNewMoney );
ITEM_GiveItem( id, iItem );
}
return;
}
// Item Buy Functions
bool:ITEM_MenuCanBuyCheck( id )
{
if ( !get_pcvar_num( CVAR_wc3_buy_dead ) && !is_user_alive( id ) )
{
client_print( id, print_center, "%L", id, "NOT_BUY_ITEMS_WHEN_DEAD" );

return false;
}

else if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
{

if ( get_pcvar_num( CVAR_wc3_buy_time ) && !g_buyTime )
{
   client_print( id, print_center, "%L", id, "SECONDS_HAVE_PASSED_CANT_BUY", ( get_cvar_float( "mp_buytime" ) * 60.0 ) );
   return false;
}

else if ( get_pcvar_num( CVAR_wc3_buy_zone ) && !cs_get_user_buyzone( id ) && is_user_alive( id ) )
{
   client_print( id, print_center, "%L", id, "MUST_BE_IN_BUYZONE" );
   
   return false;
}
}

return true;
}
// Item Preset Function
ITEM_GiveItem( id, iItem )
{
// This item we should use instantly
if ( ITEM_CheckFlag( iItem, ITEM_USEONBUY ) )
{
if ( iItem == ITEM_TOME )
{
   ITEM_Tome( id );
   return;
}
}
// They are just adding some charges
else
{
// Actually set our item variable
if ( is_user_alive( id ) )
{
   ITEM_Equip( id, iItem );
}
// Display message to the user regarding the item they just purchased
ITEM_DisplayMessage( id, iItem );
// Give bonuses
ITEM_GiveBonuses( id, iItem );
// Play purchase sound
emit_sound( id, CHAN_STATIC, g_szSounds, 1.0, ATTN_NORM, 0, PITCH_NORM );
}
WC3_ShowBar( id );
return;
}
ITEM_DisplayMessage( id, iItem )
{
// Display a message regarding the item they just purchased
switch ( iItem )
{
case ITEM_ANKH:
{
   (g_MOD == GAME_DOD)      ? client_print( id, print_chat,"%s %L", g_MODclient, id, "DOD_INFO_SHOPMENU_1" ) : 0;
   (g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO) ? client_print( id, print_chat,"%s %L", g_MODclient, id, "INFO_SHOPMENU_1" ) : 0;
}
case ITEM_BOOTS:
{
   if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
   {
    client_print( id, print_chat,"%s %L", g_MODclient, id, "INFO_SHOPMENU_2", ( ( get_pcvar_float( CVAR_wc3_boots ) ) * 100.00 ) );
   }
   else if ( g_MOD == GAME_DOD )
   {
    client_print( id, print_chat,"%s %L", g_MODclient, id, "DOD_INFO_SHOPMENU_2" );
   }
}
case ITEM_CLAWS:
{
   client_print( id, print_chat,"%s %L", g_MODclient, id, "INFO_SHOPMENU_3", get_pcvar_num( CVAR_wc3_claw ) );
}
case ITEM_CLOAK:
{
   new Float:fInvis = 100.0 * ( float( get_pcvar_num( CVAR_wc3_cloak ) ) / 255.0 );
   client_print(id, print_chat,"%s %L", g_MODclient, id, "INFO_SHOPMENU_4", fInvis );
}
case ITEM_MASK:
{
   new Float:fMask = ( 100.0 * get_pcvar_float( CVAR_wc3_mask ) );
   client_print(id, print_chat,"%s %L", g_MODclient, id, "INFO_SHOPMENU_5", fMask );
}
case ITEM_NECKLACE:
{
   client_print( id, print_chat, "%s %L", g_MODclient, id, "INFO_SHOPMENU_6", NECKLACE_CHARGES );
}
case ITEM_FROST:
{
   new Float:fFrost = 100.0 * ( get_pcvar_float( CVAR_wc3_frost ) / 260.0 );
   client_print(id, print_chat,"%s %L", g_MODclient, id, "INFO_SHOPMENU_7", fFrost );
}
case ITEM_HEALTH:
{
   client_print(id, print_chat,"%s %L", g_MODclient, id, "INFO_SHOPMENU_8", get_pcvar_num( CVAR_wc3_health ) );
}
case ITEM_SCROLL:
{
   if ( is_user_alive( id ) )
   {
    client_print( id, print_chat, "%s %L", g_MODclient, id, "INFO_SHOPMENU2_1" );
   }
   else
   {
    client_print( id, print_chat, "%s %L", g_MODclient, id, "INFO_SHOPMENU2_1_DEAD" );
   }
}
case ITEM_PROTECTANT:
{
   client_print( id, print_chat, "%s %L", g_MODclient, id, "INFO_SHOPMENU2_2" );
}
case ITEM_HELM:
{
   client_print( id, print_chat, "%s %L", g_MODclient, id, "INFO_SHOPMENU2_3", HELM_CHARGES );
}
case ITEM_AMULET:
{
   client_print( id, print_chat, "%s %L", g_MODclient, id, "INFO_SHOPMENU2_4" );
}
case ITEM_SOCK:
{
   client_print( id, print_chat, "%s %L", g_MODclient, id, "INFO_SHOPMENU2_5" );
}
case ITEM_GLOVES:
{
   client_print( id, print_chat, "%s %L", g_MODclient, id, "INFO_SHOPMENU2_6" );
}
case ITEM_RING:
{
   client_print( id, print_chat, "%s %L", g_MODclient, id, "INFO_SHOPMENU2_7" );
}
case ITEM_CHAMELEON:
{
   client_print( id, print_chat, "%s %L", g_MODclient, id, "INFO_SHOPMENU2_8" );
}
case ITEM_MOLE:
{
   client_print( id, print_chat, "%s %L", g_MODclient, id, "INFO_SHOPMENU2_9" );
}
}
}
// Give the user bonuses for their items (except charges)
ITEM_GiveAllBonuses( id )
{
// Loop through all item slots
for ( new i = ITEM_SLOT_ONE; i <= ITEM_SLOT_TWO; i++ )
{

// Do we have a valid item here?
if ( g_iShopMenuItems != ITEM_NONE )
{
   // Don't want to give the user more charges for free do we?
   //And we don't want to give the bonuses if this is a next round use item (i.e. if we do then mole for infinity - that doesn't seem nice)
   if ( !ITEM_CheckFlag( g_iShopMenuItems, ITEM_CHARGEABLE ) && !ITEM_CheckFlag( g_iShopMenuItems, ITEM_NEXTROUNDUSE ) )
   {
    ITEM_GiveBonuses( id, g_iShopMenuItems );
   }
}
}
}
// Give our players their bonus!
ITEM_GiveBonuses( id, iItem )
{

// Display a message regarding the item they just purchased
switch ( iItem )
{
case ITEM_ANKH:
{
   g_bPlayerBoughtAnkh = true;
}
case ITEM_BOOTS:
{
   SHARED_SetSpeed( id );
}
case ITEM_CLOAK:
{
   SHARED_INVIS_Set( id );
}
case ITEM_NECKLACE:
{
   g_iNecklaceCharges += NECKLACE_CHARGES;
}
case ITEM_HEALTH:
{
   new iHealth = get_pcvar_num( CVAR_wc3_health );
   iHealth += get_user_health( id );
   set_user_health( id, iHealth );
}
case ITEM_SCROLL:
{
   if ( !is_user_alive( id ) )
   {
    ITEM_Scroll( id );
   }
}
case ITEM_HELM:
{
   g_iHelmCharges += HELM_CHARGES;
}
case ITEM_SOCK:
{
   SHARED_SetGravity( id );
}
case ITEM_GLOVES:
{
   ITEM_Gloves( id );
}
case ITEM_RING:
{
   g_iTotalRings += RING_INCREMENT;
   if ( !task_exists( TASK_ITEM_RING + id ) )
   {
    _ITEM_Ring( id );
   }
}
case ITEM_CHAMELEON:
{
   SHARED_ChangeSkin( id, SKIN_SWITCH );
}
case ITEM_MOLE:
{
   g_bPlayerBoughtMole = true;
}
}
}
// Item Equip Function
ITEM_Equip( id, iItem )
{
new iItemSlot = ITEM_GetSlot( id );
// Items are not full
if ( iItemSlot != ITEM_SLOT_FULL )
{
new iOldItem = g_iShopMenuItems;
if ( iItem == iOldItem || ITEM_Has( id, iItem ) > ITEM_NONE )
{
   // Might hit this if we added charges - we want to update the user's HUD
   WC3_ShowBar( id );
   return;
}
// Remove the user's old item if necessary
else if ( g_iShopMenuItems > ITEM_NONE )
{
   ITEM_Remove( id, iItemSlot );
}
   
// Set their new item
g_iShopMenuItems = iItem;
}
WC3_ShowBar( id );
return;
}
// Item Remove Functions
ITEM_RemoveID( id, iItem )
{
new iItemSlot = ITEM_Has( id, iItem );
if ( iItemSlot > ITEM_NONE )
{
ITEM_Remove( id, iItemSlot );
}
return;
}
ITEM_Remove( id, iItemSlot, bResetAnkhMole = true )
{
new iItem = g_iShopMenuItems;
g_iShopMenuItems = ITEM_NONE;
switch( iItem )
{
case ITEM_ANKH:
{
   if ( bResetAnkhMole )
   {
    g_bPlayerBoughtAnkh = false;
   }
}
case ITEM_BOOTS:
{
   SHARED_SetSpeed( id );
}
case ITEM_CLOAK:
{
   SHARED_INVIS_Set( id );
}
case ITEM_NECKLACE:
{
   g_iNecklaceCharges = 0;
}
case ITEM_HEALTH:
{
   new iNewHealth = get_user_health( id ) - get_pcvar_num( CVAR_wc3_health );
   
   // Lets not kill the user, give them 1 health
   iNewHealth = ( ( iNewHealth <= 0 ) ? 1 : iNewHealth );
   set_user_health( id, iNewHealth );
}
case ITEM_HELM:
{
   g_iHelmCharges = 0;
}

case ITEM_SOCK:
{
   SHARED_SetGravity( id );
}
case ITEM_GLOVES:
{
   if ( task_exists( TASK_ITEM_GLOVES + id ) )
   {
    remove_task( TASK_ITEM_GLOVES + id );
   }
}
case ITEM_RING:
{
   if ( task_exists( TASK_ITEM_RING + id ) )
   {
    remove_task( TASK_ITEM_RING + id );
   }
   
   // Set the number of rings to 0
   g_iTotalRings = 0;
}
case ITEM_CHAMELEON:
{
   SHARED_ChangeSkin( id, SKIN_RESET );
}
case ITEM_MOLE:
{
   if ( bResetAnkhMole )
   {
    g_bPlayerBoughtMole = false;
   }
}
}
WC3_ShowBar( id );
return;
}
ITEM_RemoveCharge( id, iItem )
{
if ( ITEM_Has( id, iItem ) > ITEM_NONE )
{
switch ( iItem )
{
   case ITEM_NECKLACE:
   {
    g_iNecklaceCharges -= CHARGE_DISPOSE;
   
    if ( g_iNecklaceCharges <= 0 )
    {
   ITEM_RemoveID( id, iItem );
    }
   }
   case ITEM_HELM:
   {
    g_iHelmCharges -= CHARGE_DISPOSE;
   
    if ( g_iHelmCharges <= 0 )
    {
   ITEM_RemoveID( id, iItem );
    }
   }
   case ITEM_RING:
   {
    g_iTotalRings -= CHARGE_DISPOSE;
   
    if ( g_iTotalRings <= 0 )
    {
   ITEM_RemoveID( id, iItem );
    }
   }
}
}
WC3_ShowBar( id );
return;
}

// Item Get Functions
ITEM_GetSlot( id )
{
if ( g_iShopMenuItems > ITEM_NONE && g_iShopMenuItems > ITEM_NONE )
return ITEM_SLOT_FULL;
else if ( g_iShopMenuItems > ITEM_NONE )
return ITEM_SLOT_TWO;
return ITEM_SLOT_ONE;
}
ITEM_Has( id, iItem )
{
if ( g_iShopMenuItems == iItem )
return ITEM_SLOT_ONE;
else if ( g_iShopMenuItems == iItem )
return ITEM_SLOT_TWO;
return ITEM_NONE;
}
// Item Death Function
ITEM_UserDied( id )
{
// The user just died, remove all items
if ( g_iShopMenuItems > ITEM_NONE )
{
ITEM_Remove( id, ITEM_SLOT_ONE, false );
}
if ( g_iShopMenuItems > ITEM_NONE )
{
ITEM_Remove( id, ITEM_SLOT_TWO, false );
}
}
// Item Specific Functions
ITEM_Offensive( iAttacker, iVictim, iWeapon, iDamage, iHitPlace )
{
// Claws of Attack
if ( ITEM_Has( iAttacker, ITEM_CLAWS ) > ITEM_NONE )
{
WC3_Damage( iVictim, iAttacker, get_pcvar_num( CVAR_wc3_claw ), iWeapon, iHitPlace );

SHARED_Glow( iAttacker, (2 * get_pcvar_num( CVAR_wc3_claw ) ), 0, 0, 0 );
Create_ScreenFade( iVictim, (1<<10), (1<<10), (1<<12), 255, 0, 0, g_GlowLevel );
}
// Mask of Death
if ( ITEM_Has( iAttacker, ITEM_MASK ) > ITEM_NONE )
{
new iHealth = get_user_health( iAttacker );
new iBonusHealth = floatround( float( iDamage ) * get_pcvar_float( CVAR_wc3_mask ) );

new iVampiricBonus = SM_GetSkillLevel( iAttacker, SKILL_VAMPIRICAURA );

// Then the user already gets a bonus, lets lower the total amount the user is going to get
if ( iVampiricBonus )
{
   iBonusHealth /= iVampiricBonus;
}

// User needs to be set to max health
if ( iHealth + iBonusHealth > get_user_maxhealth( iAttacker ) )
{
   set_user_health( iAttacker, get_user_maxhealth( iAttacker ) );
}

// Give them bonus
else
{
   set_user_health( iAttacker, iHealth + iBonusHealth );
}
SHARED_Glow( iAttacker, 0, iBonusHealth, 0, 0 );
Create_ScreenFade( iAttacker, (1<<10), (1<<10), (1<<12), 0, 255, 0, g_GlowLevel );
}
// Orb of Frost
if ( ITEM_Has( iAttacker, ITEM_FROST ) > ITEM_NONE )
{
// Only slow them if they aren't slowed/stunned already
if ( !SHARED_IsPlayerSlowed( iVictim ) )
{
   p_data_b = true;
   SHARED_SetSpeed( iVictim );
   set_task( 1.0, "SHARED_ResetMaxSpeed", TASK_RESETSPEED + iVictim );
   SHARED_Glow( iAttacker, 0, 0, 0, 100 );
   Create_ScreenFade( iVictim, (1<<10), (1<<10), (1<<12), 255, 255, 255, g_GlowLevel );
}
}
}
ITEM_Tome( id )
{
new iXp = get_pcvar_num( CVAR_wc3_tome ) + XP_GivenByLevel( p_data );

if ( g_MOD == GAME_DOD )
{
iXp *= 2;
}
new iBonusXP = XP_Give( id, iXp );
if ( iBonusXP != 0 )
{
client_print( id, print_chat, "%s %L", g_MODclient, id, "INFO_SHOPMENU_9", iBonusXP );
}
emit_sound( id, CHAN_STATIC, "warcraft3/Tomes.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
return;
}
ITEM_Gloves( id )
{
if ( !WC3_Check() )
{
return;
}
if ( !SHARED_HasGrenade( id ) )
{
g_iGloveTimer = 0;
_ITEM_Glove_Give( id );
}
return;
}
ITEM_Glove_Begin( id )
{
// Then lets start a timer to give them a grenade!
g_iGloveTimer = get_pcvar_num( CVAR_wc3_glove_timer );
WC3_StatusText( id, TXT_TIMER, "%d second(s) until your next grenade", g_iGloveTimer );
g_iGloveTimer--;
set_task( 1.0, "_ITEM_Glove_Give", TASK_ITEM_GLOVES + id );
}
public _ITEM_Glove_Give( id )
{
if ( !WC3_Check() )
{
return;
}
if ( id >= TASK_ITEM_GLOVES )
{
id -= TASK_ITEM_GLOVES;
}
if ( !p_data_b || !is_user_alive( id ) )
{
return;
}
// Only need to save once! - this is b/c I'm not sure when the loss of a grenade is updated - and I wanted SHARED_HasGrenade to work @ all times!
if ( g_iGloveTimer == get_pcvar_num( CVAR_wc3_glove_timer ) - 1 )
{
SHARED_SaveWeapons( id );
}
// If somehow they already got a grenade - stop this!
if ( cs_get_user_bpammo( id, CSW_HEGRENADE ) > 0 )
{
g_iGloveTimer = 0;
return;
}
if ( g_iGloveTimer > 0 )
{
WC3_StatusText( id, TXT_TIMER, "%d second(s) until your next grenade", g_iGloveTimer );
g_iGloveTimer--;
set_task( 1.0, "_ITEM_Glove_Give", TASK_ITEM_GLOVES + id );
return;
}
// Counter-Strike or Condition Zero grenade
if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
{
give_item( id, "weapon_hegrenade" );
}
// Day of Defeat
else if ( g_MOD == GAME_DOD )
{
if ( get_user_team( id ) == ALLIES )
{
   give_item( id, "weapon_handgrenade" );
}
else
{
   give_item( id, "weapon_stickgrenade" );
}
}
// Display a message to the user
WC3_StatusText( id, TXT_TIMER, "%L", id, "ENJOY_A_GRENADE" )
return;
}
ITEM_BuyRings( id )
{
new iItemSlot = ITEM_GetSlot( id );
// Items are full
if ( iItemSlot == ITEM_SLOT_FULL && ITEM_Has( id, ITEM_RING ) == ITEM_NONE )
{
g_iFutureItem = -3;
MENU_ReplaceItem( id );
return;
}
new iMoney;
new iAdditionalRings = 0;

while ( g_iTotalRings + iAdditionalRings < 5 )
{
iMoney = SHARED_GetUserMoney( id );
if ( iMoney < ITEM_Cost( id, ITEM_RING ) )
{
   break;
}
iAdditionalRings++;

new iNewMoney = iMoney - ITEM_Cost( id, ITEM_RING );
SHARED_SetUserMoney( id, iNewMoney, 1 );
}
// Then we need to give them some rings!
if ( iAdditionalRings > 0 )
{
// Subtract 1 b/c ITEM_GiveItem will add one
g_iTotalRings += ( ( iAdditionalRings * RING_INCREMENT ) - ( RING_INCREMENT ) );
ITEM_GiveItem( id, ITEM_RING );
}
return;
}
public _ITEM_Ring( id )
{
if ( !WC3_Check() )
{
return;
}
if ( id >= TASK_ITEM_RING )
{
id -= TASK_ITEM_RING;
}
if ( !p_data_b || ITEM_Has( id, ITEM_RING ) == ITEM_NONE )
{
return;
}
new iBonusHealth = g_iTotalRings;
while ( iBonusHealth > 0 )
{
new iHealth =get_user_health( id ) + 1;
if ( iHealth <= get_user_maxhealth( id ) )
{
   set_user_health( id, iHealth );
}
iBonusHealth--;
}
set_task( 2.0, "_ITEM_Ring", TASK_ITEM_RING + id );
return;
}
ITEM_Scroll( id )
{
// Make sure the user isn't about to respawn when we do these checks
if ( !p_data )
{
p_data = RESPAWN_ITEM;
set_task( SPAWN_DELAY, "_SHARED_Spawn", TASK_SPAWN + id );
}
}
ITEM_CheckFlag( iItemID, iFlag )
{
if ( g_iFlag & iFlag )
{
return true;
}
return false;
}
// Format the item for WC3_ShowBar
ITEM_Format( id, iItem, szItemString[], iLen )
{
new szItemName;
LANG_GetItemName( iItem, id, szItemName, 31, true );
// Special options
if ( iItem == ITEM_NECKLACE )
{
formatex( szItemString, iLen, "%s[%d]", szItemName, g_iNecklaceCharges );
}
else if ( iItem == ITEM_HELM )
{
formatex( szItemString, iLen, "%s[%d]", szItemName, g_iHelmCharges );
}
else if ( iItem == ITEM_RING )
{
formatex( szItemString, iLen, "%s[%d]", szItemName, g_iTotalRings );
}

// All other cases
else
{
copy( szItemString, iLen, szItemName );
}
}

daredevil 发表于 2008-12-9 00:11:50

回复: 胜利之日DOD魔兽插件问题请教

ITEM_COST = 1750; // Flaming Gloves of Warmth
这个就是手套价格,我修改后无法编译,郁闷。

lanmao 发表于 2008-12-9 05:32:39

回复: 胜利之日DOD魔兽插件问题请教

跟你提醒 下..要保存为UTF-8无BOM 格式的

daredevil 发表于 2008-12-9 20:30:54

回复: 胜利之日DOD魔兽插件问题请教

头都搞大了。貌似这个有问题啊。麻烦大哥帮忙修改下发给我啊。。

liubojf 发表于 2011-1-14 18:15:54

不头大才怪呢,那个东西太复杂了

w575892495 发表于 2011-4-22 20:04:54

asdadadasd
页: [1]
查看完整版本: 胜利之日DOD魔兽插件问题请教