Jump to content

avertuss

Inactive Member
  • Posts

    480
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by avertuss

  1. Hi. How to use that function in quest? I tried but i always have error in quest compile

     

    function pc.make_guild(guild_name, required_money, required_level)
            --[[to clean non alphanumeric characters]]
            local guild_name = string.gsub(guild_name, "[^A-Za-z0-9]", "")
            local guild_len_name = string.len(guild_name)
            --[[to check wrong sized names]]
            if not ((2 < guild_len_name) and (guild_len_name < 12)) then
                say_reward("The name should not have special characters and its length should be between 3-11 characters!")
                return
            end
            --[[to check required level]]
            if not (pc.get_level() >= required_level) then
                say_reward(string.format("Level too low. Needed: %d", required_level))
                return false
            end
            --[[to check required money]]
            if not (pc.get_gold() >= required_money) then
                say_reward(string.format("Not enough money. Needed: %d", required_money))
                return false
            end
            --[[to check already guilded people]]
            if (pc.hasguild() or pc.isguildmaster()) then
                say_reward("You're already inside a guild.")
                return
            end
            --[[to add a user-validation check]]
            say(string.format("Are you sure you wanna create such guild?[ENTER]%s", guild_name))
            if select("Yes", "No")==2 then
                return false
            end
            --[[create the guild and process the return value]]
            local ret = pc.make_guild0(guild_name)
            if ret==-2 then
                say_reward("[NO] guild name is invalid (strlen <2 or >11!)")
            elseif ret==-1 then
                say_reward("[NO] guild name is invalid (special chars found!)")
            elseif ret==0 then
                say_reward("[NO] guild not created (guild name already present or already member of a guild)")
            elseif ret==1 then
                pc.change_gold(-required_money)
                say_reward("[YES] guild created")
                return true
            elseif ret==2 then
                say_reward("[NO] player already part of a guild")
            elseif ret==3 then
                say_reward("[NO] player already guild master")
            end
            return false
        end

     

  2. 20 godzin temu, boaspessoal napisał:

    Not tested:

      Odkryj ukrytą treść
    
    
    if (pAttacker)
    {
    	LPITEM item = pAttacker->GetWear(WEAR_WEAPON);
    	if (item == NULL)
    		return;
    	else if (item == 105)
    		dam = 10;
    }

     

     

    char_battle.cpp: In member function 'bool CHARACTER::Damage(CHARACTER*, int, EDamageType)':
    char_battle.cpp:1971: error: ISO C++ forbids comparison between pointer and integer
     

  3. 2 godziny temu, kasko30 napisał:

    check the .msm file of the mob

     

    31 minut temu, .T4Ump napisał:

    In msm, height.

    Hmm, it's msm of the mob

    ScriptType            RaceDataScript
    
    BaseModelFileName     "D:\ymir work\monster\forest_boss\forest_Boss.GR2"
    
    Group ShapeData
    {
        PathName 		 ""
        ShapeDataCount 		 0
    }
    Group AttachingData
    {
        AttachingDataCount       1
        
        Group AttachingData00
        {
            AttachingDataType    1
            
            isAttaching          1
            AttachingModelIndex  0
            AttachingBoneName    "Dummy02"
            
            CollisionType        3
            
            SphereDataCount      2
            Group SphereData00
            {
                Radius           137.000000
                Position         0.000000 0.000000 0.000000
            }
            Group SphereData01
            {
                Radius           183.000000
                Position         0.000000 0.000000 150.000000
            }
        }
    }

    Which value is height? 

  4. 8 godzin temu, tierrilopes napisał:

    For hit damage:

    Look for:

    
    	if (iDam <= 0) {
    		return (BATTLE_DAMAGE);
    	}

    Paste this ABOVE:

    
    	//begin hit block damage with sword +5   (vnum 15)
    	if (pkAttacker->FindSpecifyItem(15) && pkVictim->IsNPC())
    	{
    		iDam = 0;
    	}
    	//end hit block damage with sword + 5(vnum 15)

    Like in the print:

    imagem86d661f4a7c29d0c.png

     

    Go ingame and test it.

    If you damage a mob with a hit while having a sword +5 (vnum) in inventory, damage will be 0.

     

    That will work for weapon hits.

    You also need to edit this function for arrows damage:

    
    int CalcArrowDamage

     

    And if you also want to block skills damage, you will need to edit it at char_skill.cpp, here:

    
    FuncSplashDamage

     

    I don't need block deal damage when item is in inventory, i want block deal damage when item is equpped. 

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.